- Enable root permission (BEWARE: there is no going back; only do this if you need complete control over the server)
- Install Developer Tools (this setting is located in the same section where you setup root access)
- Setup root password.
- Setup a domain or subdomain.
- Add a new ftp user and set "Access to the server over SSH" to "/bin/bash" (this will let you use putty and command line)
- Login to the server using Putty (I setup a profile and save the server settings)
- Login as root and enter password created above.
- Run this command: "yum -y install python-pip"
- Once installed you can now install packages via pip on command line.
- run this command: "yum install git"
- Create a new private repo.
- Create a new branch and call it "staging" or "development" or "dev". I used "staging"
- Click Settings -> Branches. Make the "staging" branch the default branch. Make staging branch "protected" (still testing this. I'm new to this feature)
- Add a new site to your webhost (I use Mediatemple and Rackspace Cloud Sites)
- Add new subdomain for your website called "staging" (ex: staging.yourwebsite.com)
- Add a new ftp user to your subdomain and to your live site. Save these details, you'll need them later. It can be the same ftp account, just make sure that it has access to both websites. At mediatemple, it should be easy enough because subdomains are added below the main site in ftp. Just note the path.
This service will allow you to automatically update your server code from github.com when a merge happens on the specified branch. After you register with the website, you'll have to walkthrough the steps. You'll connect the website to your Github account, you'll add a server, and create a project to link them all together. I setup two projects and two servers for each website. One is for staging and the other is to deploy to the live site. Follow below:
- Login and choose Servers -> New Server. Call this one staging.yourdomainname.com (the site we setup before)
- Enter in a host, user, pass and port. Test the connection.
- If it passes, click Save Server.
- That adds that server to your account.
- Choose Projects -> New Project and fill out the form.
- Choose the repository.
- Enter a Project Name. Lets call this one "staging.yourdomainname.com".
- Choose the "staging" branch. You'll see all current branches listed in the list.
- Leave the "deploy from the following directory only" empty, unless you have code in a certain folder, then you'll need to specify the folder here.
- Choose the Server from the drop down menu.
- Enter the server path. (ex: For mediatemple, I used "/httpdocs/" for my main website as the path. The staging server will have a path like /staging.yourdomainname.com/)
- I left the Pre-deployment Hook and Post-deployment Hook fields empty.
yum install postgresql postgresql-server
service postgresql initdb
/etc/init.d/postgresql start
See this page: https://mediatemple.net/community/products/dv/204404394/how-do-i-install-postgresql-on-my-server
http://joshuapaling.com/blog/2013/08/07/how-to-install-rails-media-temple-dv.html