Installing a Web Server+On GNU Linux

Install a web server Nginx or Apache

To use a different webserver, please see Ruby on Rails documentation. (And let us know how it goes!)

 

Nginx and Passenger

 

You will need an http server to run your applications. Nginx is fast, lightweight and easy to configure and Phusion Passenger module makes Nginx and Rails integration painless. Firstly, install Passenger gem:

 

$ sudo gem install passenger

 

and then, install Nginx with compiled Passenger module:

 

$ sudo passenger-install-nginx-module

 

*depending on the system you are running the module needs ssl to work so read the instructions on screen to what it says, on Debian it was:

$ sudo apt-get install libcurl4-gnutls-dev

 

Choose the recommended install mode.

 

Now, open the Nginx configuration file (/opt/nginx/cong/nginx.conf if you haven’t changed it during installation).

 

$ sudo nano /opt/nginx/conf/nginx.conf

 

Let’s change some default config. Change worker_processes to be equal to number of CPU cores. You can also enable gzip compression. Just add following lines:

 

gzip on;

gzip_vary on;

gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

 

* parts from http://karolgalanciak.com/blog/2013/07/19/centos-6-4-server-setup-with-ruby-on-rails-nginx-and-postgresql/

 

 

how to install nginx and apache in MacOS