Proper rails deployment steps to DirectAdmin (or any hosting not focusing in apps) hosted server?

381 views
Skip to first unread message

southi...@gmail.com

unread,
Jul 29, 2013, 9:53:42 AM7/29/13
to rubyonra...@googlegroups.com
Hi,
 
With PHP applications (only experience I had before), all I needed to do is to FTP all required files, create MySQL username/pass & upload SQL structure, add this username/pass in any given config file of the php script and the app worked.
 
Can you tell me what are standard/proper steps required to deploy an app that I worked on my local Ubuntu machine and want to have it working on 'standard' web hosting company that does not specialize in Rails app hosting?
 
Thanks,
 
Rob

Frederick Cheung

unread,
Jul 31, 2013, 4:06:05 AM7/31/13
to rubyonra...@googlegroups.com
While there are many ways of deploying rails applications, it's extremely unlikely that a non rails specialist will have installed/configured any of them. If you're looking for an easy way to deploy a rails app, it's hard to beat heroku for simplicity.

Fred


> Thanks,
>  
> Rob

southi...@gmail.com

unread,
Jul 31, 2013, 3:26:08 PM7/31/13
to rubyonra...@googlegroups.com
What is most popular way to deploy apps on non-Heroku machine that has standard Apache/MySQL setup? I would like to be able to deploy my apps (as I learn Rails) to my own dedicated machines. I have already installed Ruby, & rails gem, and I'm able to create apps on that machine without any issues. It is when I develop something localy when I face issue as I don't know how to deploy it "properly"? Do I simply upload entire app folder structure over FTP, run bundle install, config database, and start the app OR is there a faster/easier way?

Hassan Schroeder

unread,
Jul 31, 2013, 3:33:13 PM7/31/13
to rubyonra...@googlegroups.com
On Wed, Jul 31, 2013 at 12:26 PM, <southi...@gmail.com> wrote:
> What is most popular way to deploy apps on non-Heroku machine that has
> standard Apache/MySQL setup?

One option: http://www.capistranorb.com/

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Tamara Temple

unread,
Jul 31, 2013, 9:05:29 PM7/31/13
to rubyonra...@googlegroups.com

On Jul 29, 2013, at 8:53 AM, southi...@gmail.com wrote:
> With PHP applications (only experience I had before), all I needed to do is to FTP all required files, create MySQL username/pass & upload SQL structure, add this username/pass in any given config file of the php script and the app worked.

Yes, deploying PHP is quite simple compared to Rails.

> Can you tell me what are standard/proper steps required to deploy an app that I worked on my local Ubuntu machine and want to have it working on 'standard' web hosting company that does not specialize in Rails app hosting?

I don't have anything written (which I should) but just googling around, here's a few:

* http://blog.sudobits.com/2013/01/07/how-to-deploy-rails-application-to-vps/
* http://rubysource.com/deploying-a-rails-application/
* http://tommy.chheng.com/2013/01/23/deploying-a-rails-app-on-nginxpuma-with-capistrano/

There's also a pragprog book: http://pragprog.com/book/cbdepra/deploying-rails which I haven't read.

If you hosting solution does not offer shell access, it's going to be very difficult, I think to do an effective deploy. Even moreso if your application requires gems that need to have native extensions compiled.

There are some great Rails-hosting PaaS out there: heroku, EngineYard, CloudFront, etc.

My most recent job, we used AWS to host our app, and deployed using Chef (opscode.com) which was really nice to work with.

kaichanvong

unread,
Aug 1, 2013, 7:37:18 AM8/1/13
to rubyonra...@googlegroups.com
I've found Nitrous really nice for testing apps somewhere in the cloud: https://www.nitrous.io/join/WWm_3k15gFU

They encourage you to deploy apps (as others suggest) to heroku.

NB. I've no affiliation to Nitrious, but that link does include my referral code for more Nitrous points.

Kamil

unread,
Aug 22, 2013, 12:36:57 PM8/22/13
to rubyonra...@googlegroups.com
I have a dedicated DirectAdmin server running on CentOS and what worked for me is the following:

(Please note I make assumption you have default DA config setup with Apache/MySQL)

1. Install Ruby, and Rails gem
2. Install passenger: gem install passenger --pre
3. Install apache server module: passenger-install-apache2-module
4. Read the output from (3) and add necessary to your /etc/httpd/conf/httpd.conf. It will ask you to add few modules.
5. Create Rails app in some directory (ie. /home/SOME_USER/rails_app). This means: PROD config/database.yml has mysql config filled out, gem 'mysql2' is installed, bundle install, RAILS_ENV=production bundle exec rake db:migrate, etc.
6. Modify respective  /usr/local/directadmin/data/users/SOME_USER/httpd.conf as per instructions from point (3):

- change path within <Directory ..... > to point to  /home/SOME_USER/rails_app/public and add these two conditions:

 AllowOverride all
 Options -MultiViews

- change DocumentRoot to point to /home/SOME_USER/rails_app/public

7. Restart Apache, and you are all set. You can now access your domain.com and your app is running. Steps 1-4 are one time setup only. Steps 5-7 when you want to run additional apps. Google for additional config / tuning.


Hopefully this helps,

Kamil
Reply all
Reply to author
Forward
0 new messages