How to install software from media to remote server? - dedicated-hosting

I will be renting a virtual or dedicated server (might be Amazon EC2 or from SoftLayer). I was wondering what is the best way to install software from CD to the remote server?

Turn it into an ISO and upload the ISO to the server, then mount it there.

Related

docker, vagrant sandboxes in php development

I have a missunderstanding and i want to find the best approach of a development sandbox environment for a PHP project.
I have a github repo that will host the code , .php, .js (will using webpack with babel), .scss files and different machines for development (windows, mac, ubuntu) .
I want to be able to pull the code from git hub , run a command (like vagrant up) and start a VM / container / sandbox with apache2 , php, nodejs that will run to parse .scss files and .js files into one and then be able to start the server on every platform without having to run gulp locally on developers PC, and then have the XAMPP installed with the correct path for apache2 http folder.
What would be the best approach ? To use vagrant VM with a file config on the repo or docker containers ?
I just want to simplify the development experience and to have this automated tools that start a server, compile sass and babel js.
Thank you
While I am a big Docker fan, it isn't always the right tool for the job. Docker has principals like immutability and single-service-per-container that probably won't work well for what you're looking to do without a learning curve.
There is a great open-source Vagrant tool called PuPHPet that make configuring a development environment straightforward.
https://puphpet.com/
From the PuPHPet web site you can configure an image with Apache2, PHP, and NodeJS via their wizard and it will generate a Vagrant file that you to run locally on your workstation. This way you can have all the software you need, without having to deal with installing/maintaining it yourself. It also supports installing databases, queues, and mail applications, should you need them.
For your scenario, I would clone the code from Github onto your workstation (not the VM) and mount it using Synced Folders against Vagrant, but still directly accessible by your IDE.

Can I keep my database on my local network but deploy my rails app on a hosting service?

I have a rails application that is currently hosted on Heroku. It is used on our local network only, and my boss does not want a 3rd party hosting our data. I convinced IT to set me up a virtual windows server to deploy my app on. However, it has been very difficult to set up for production.
Is there anyway that I can use a hosting service for my application, but have the database reside on our local network?
Or is there an easier way to deploy a rails app on a windows server? I have been looking into using the Linux Subsystem for Windows.
If your app is used on your local network only, why not ditch Heroku and host your Rails app locally as well? What benefit is a scalable cloud hosting provider giving you? Especially since it seems your boss has security concerns about remote hosting of a database. Bringing the entire thing in house may be the best solution.
Simple answer is yes you can, but why would you. It's simpler to run your application locally than connecting your remote app to a local database.
Your best bet is to use a Linux virtual machine instead of Windows, usually there is to much hassle to get rails application to work on windows, especially compiling native gems.
I suggest that you get a CentOS VM, and install Nginx with passenger gem using rbenv or rvm.
Digital Ocean has a nice guide that explains this process in details:
How To Deploy Rails Apps Using Passenger With Nginx on CentOS 6.5

Ruby On Rails deploy in Amazon Web Services - General

I am planning to deploy an application on AWS. It is an application that exposes some REST/Json webservices.
It has a CMS UI created used active_admin.
Can I deploy that system in AWS? Or it is intended to be used only to deploy webservices systems?
Thanks
In addition to Joe's answer, EC2 gives you a virtual server. You can log on the the virtual computer with ssh and install any software you need.
You don't even have to run a web server - if you wanted to run a program to process information (ie, render computer graphics images), you could do that as well.
I think what you are looking for is Amazon EC2 (which is part of AWS). You can setup a small instance pretty quickly and that should let you deploy your rails application.

Ruby on Rails - Capistrano and SVN on Windows. Setup help

I have Subversion setup and running on my local network with windows and svnserve. I'd like to use Capistrano to deploy to a remote ubuntu server but am a bit on unsure on what I need to do to get the client end to work on windows. My understanding is that the remote server needs to be able to tunnel into my subversion server. I've read over a few tutorials but either they or I get all turned around about when they are talking about my local system, my svn server, or my remote system and of course almost none of them talk about capistrano and windows together.
Do I need to setup Apache to serve my subversion repository? I'd rather not but if I must what are the steps?
I found this tutorial but I have no idea if it will enable ssh access to the repository
You could try having capistrano checkout your code locally, zip and send it to the server. This isn't as efficient has having the server access svn because it has to send the entire codebase every time, but it will save you the trouble of exposing your repository to the outside.
From this page on the capistrano website, under Deployment Strategies:
set :deploy_via, :copy
set :copy_strategy, :export
set :copy_compression, :zip
You will need a command line zip utility available to make this work. The Info-Zip FTP site has one available.
I'm not a Windows person, but my understanding is that in Capistrano's normal state, it executes all of its commands on the server. That is why it needs to be able to pull the code via SVN from your machine.
Looking at that tutorial, it appears as though it is using Apache as the mechanism to allow a client(in this case Capistrano) to pull source code from your Windows machine. This will work for what you want to do.
You don't have to setup Apache in order to accomplish this, you could probably setup an SSH server on your Windows machine, though that is out of my realm of knowledge. :-)

How I turn an average desktop PC into server for hosting a website using Ruby on Rails?

What is the best way to turn an average desktop PC into server for hosting a website using Ruby on Rails?
I am open to changing operating systems, buying parts if I need to, using whatever Database People recommend and any software.
Here are the approximate details of the computer:
The computer is an HP Desktop with 1.86GHz Duo Core CPU. Intel chipset.
1GB Ram, 200GB Hard Drive
Runs on Windows XP
FYI, This is not a commercial project and this is not about saving money. I just want to pick up some new skills and I think it would be fun.
Thanks,
Jeremy
Just a suggestion, you could just use http://www.slicehost.com. You can buy a virtual machine with 256MB for $20/month but you build the machine from scratch after loading a base Linux distribution like Ubuntu. There are excellent instructions there on how set up your OS to do whatever you want to do.
If you really want to run a server on that machine you have though, thus saving $20/month, I would recommend installing some form of Linux. I would suggest Debian or Ubuntu. If you want to learn a bit more about some Linux fundamentals like building a kernel and tweaking .conf files (could be useful at some point) try a distribution like Gentoo. Basically download the ISO and boot it up.
If you just want to play with Ruby on Rails on that box, of course, just go to http://localhost. Furthermore, you don't even need to set up apache if you are just playing around... just use the web server built in to Rails. To be able to access that machine from anywhere in the world, if you have a static IP, get a domain name and point to that IP. If your IP is dynamic then use dyndns.org to get a dynamic host name. You can usually configure most routers to update sites like dyndns.org with your up-to-date dynamic IP.
While you can setup Rails on Windows, most people tend to use some flavor of Linux or BSD. The hardware you have should be more than enough for what you're asking it to do.
There are many tutorials on how to install the software you'll need. A typical stack would be Ruby, the Rails gem, MySQL (with ruby bindings and gem), Apache, and Passenger.
Slicehost, for example, has a good setup tutorial for Ubuntu. Depending on how much you want to learn about system administration, you can use a package manager to install (apt-get or aptitude on Ubuntu, for example), or compile from source.
Rails' default configuration is set up to use SQLite as the database, which requires basically no administration. If you make your site public and are getting more than a handful of users, MySQL or PostgreSQL is the next step.
Note that XP by design is limited to 10 concurrent open connections at once. This is so people need to buy the higher priced Server editions of Microsoft OSes for production servers. However, it should be fine if all you want to do is experiment.
First, you need an IP willing to give you a static IP (or get a dynamic DNS solution). DNS is what maps a URL to a IP address and a constantly changing IP address is going to give you a bunch of headaches.
Next, you need to purchase a domain and have it point to your IP. If your machine is behind a router, you need to go into the NAT settings in the router and have it forward port 80 to your machine.
Finally, you need to install some kind of web server on your local machine. If you want to work with rails, I recommend installing InstantRails which comes with the Apache web server and MySQL by default.
Once this is done, spin up InstantRails, load up a rails project and then visit your domain to see if it all works.
EngineYard, one of the bigger Rails-based hosts, offers a VMWare image of their deployment platform that you can download from http://express.engineyard.com/
It will work the the free VMWare Player http://www.vmware.com/products/player/ which runs on WinXP.
This arrangement, which I've done several times for small and internal projects, gives you a full-featured Rails server with prebuilt deployment recipes (using the engineyard-eycap gem).
Download VMWare player
Download EngineYard Express
Boot your new server in VMWare Player and go to town.
The only hardware suggestion I'd make is to add more memory -- the VMWare image used 640mb by default and performs better with more, though it doesn't sound like performance is your concern.
What's particularly nice about this solution is that you can move to a commercial option (EngineYard Solo on Amazon EC2 or the full EngineYard offering) or roll your own with Slicehost, etc once you're comfortable with Rails. But this solution puts you in charge of the development side of things without needing to waste time on the server side.
On windows, first install xampp.
http://www.apachefriends.org/en/xampp-windows.html (download and install: Installer 39 MB)
This will install apache, php and mysql database.
Then you need to install ruby: http://peri.me/?p=73
By the end, you be running ruby on your home pc.
If you want someone other than you to access the content on the server, you would need to somehow tweek your router or computer's setting to allow access.
I like Shalmanese's answer but I would add that you need a firewall. If you have no hardware one, you need to configure your iptables in linux, which is lots of fun by itself :) Especially if you have to rebuild kernel first to have it work.
you can find a lot of tutorials to setup "perfect servers" on various distros on how to forge Just search for "perfect server" on their site and you are good to go :)
Public IP Address and a sort of Linux with Apache (Passenger or mongrel).
You can run a Linux host in a virtual machine within your Windows desktop, using free software like Sun's VirtualBox or Microsoft's Virtual PC. I do this all the time to run development Linux servers for my environment, but it would work equally well for "quasi-production" hosts that you are just playing with.

Resources