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:
To set up wagn behind an Apache webserver, we recommend using Phusion Passenger. In general, you will follow the instructions for deploying a Rack-based Ruby application.
Following the above example, your apache config might look something like this:
<VirtualHost *:80> ... DocumentRoot /srv/mywagn/current/public <Directory /srv/mywagn/current/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
You will also need to make sure that the apache user (usually www-data) has read access to config.ru and read/write access to your log, tmp, and file directories
The above should help you get wagn working, but you'll have to do a bit more to make it fast.
- memcache. This is vital for a high-performing Wagn site.
To configure wagn for memcache, add this to your Gemfile:
gem 'dalli'and edit config/application.rb with the following:
config.cache_store = :dalli_store, 
- mod_xsendfile. File and Image cards process permissions before sending the file. This makes that fast.
- You'll need to enable mod_headers so that the ht_access will work (Headers directives)
- Also, you'll need to symlink to the gem's public directory if you're running a version older than 1.13 This should happen automatically whenever you run `wagn update`, but you can also do it manually using `rake wagn:update_assets_symlink