Z
Z
zion5un2014-07-25 12:13:25
Ruby on Rails
zion5un, 2014-07-25 12:13:25

What is a good guide for setting up a server for a rails application?

Gentlemen, I need help with a choice.
In general, the situation is as follows: you need to install a server on a local machine in the office and prepare it for using the rails application. A good manual is required for setting everything up, since I still have no experience in setting up all these things.
The application uses:
Rails 4
Postgresql
What rake stones to face when setting up a server?
You need to do everything yourself, since the initiative is mine and all the bumps too :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TM_ID, 2014-07-25
@zion5un

I set up the server like this:
First of all, I create a non-root, sudoer user from which I install and deploy everything (through capistrano, for example).
# non-root user
# password for deployer
# deployer a sudoer
Log in as deployer
Install RVM.
# RVM
# RVM requirements
I install Ruby through RVM.
# Ruby
Rails without docks(--no-document)
# Rails
NodeJS for js runtime
# ExecJS NodeJS Javascript runtime
MySQL/PostgreSQL
Apache
# Install Apache packs
Passenger
# Passenger
# Apache module
Configure Apache
# etc/apache2/mods-available/passenger.load
#etc/apache2/mods-available/passenger.conf

<IfModule mod_passenger.c>
     PassengerRoot /home/deployer/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.37
     PassengerDefaultRuby /home/deployer/.rvm/gems/ruby-2.1.2/wrappers/ruby
</IfModule>

Activate the passenger module for Apache
Host for Apache
# etc/apache2/sites-available/sitename
<VirtualHost *:80>
  ServerName sitename.com
  DocumentRoot /home/deployer/ror_apps/sitename/current/public # путь для capistrano. либо свой
  <Directory /home/deployer/ror_apps/sitename/current/public>
     AllowOverride all
     Options -MultiViews
  </Directory>
</VirtualHost>

Activate host
Restart Apache
config Next, set up ssh keys for deployment and git.
We install and configure capistrano and enjoy the deployment.
There are questions - ask.

E
Eugene Burmakin, 2014-07-25
@Freika

Yes, hundreds of them. https://gorails.com/setup/ubuntu/14.04 choose an axis.
For me the sequence is:
RVM
Ruby
Git
PostgreSQL
...
PROFIT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question