Note to Ruby-on-Rails developers: ever since Wagn 1.8, Wagn defaults to running in "production" mode. We've chosen this Ruby-on-Rails mode to serve the
many users who just want to use Wagn. If you're someone who wants to help build wagn, please see Wagn in development.
In general, installing Wagn for production is like any other installation. The following installation and configuration cards may be of interest:
To date, Wagn has been developed and maintained primarily on Unix-based systems, especially Mac OS X. We will soon be improving this and adding strong Windows support. In the meantime, our generous users have contributed these helpful instructions for installation on systems where they've encountered issues with our default installation process:
Installing RubyVersionManager (RVM for short) and RUBY
Make sure you are logged in as your new 'your_user' (not root):
You'll need curl for this one, install it:
$ sudo apt-get install curl
Then type in:
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby
* if you get a signature error type in the command below and try again:
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
** if you get a signature error again type this in and try again:
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
* more info at http://rvm.io/rvm/install
$ sudo apt-get install nodejs (needed when wagn update, complains about execjs)
Make sure bundler is the latest version
$ sudo gem install bundler
$ sudo apt-get install imagemagick
$ sudo apt-get install libmagickwand-dev
* parts taken form http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
Install the package:
$ sudo apt-get install postgresql
Try to install the gem:
$ sudo apt-get install libpq-dev
$ sudo gem install pg
Some actions require:
(typically the "root" user for postgresql)
Several sections have instructions stating "become the postgres user". Commands that should be run as the postgres user are prefixed by [postgres]$ in this article.
To become the postgres user execute the following:
$ sudo -i -u postgres
If you like using root to get a shell as the postgres user:
$ su - postgres
The postgres user will automatically be created by installing PostgreSQL.
Now create the user and the database:
createuser -d wagn-user -P
(enter your database user password twice)
createdb -O wagn-user wagn-database
Postgres hints: you may have to mess with authentication config in pg_hba.conf to connect. Default configs have local identity based setting for authentication, and none for remote.
# MySQL. Versions 4.1 and 5.0 are recommended.
# Be sure to use new-style password hashing:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
1. Install the gem
gem install wagn
Watch carefully for errors!
2. Create your new wagn application
Here we'll create one named "mysite":wagn new mysite
3. Create / Seed your database
Edit the config/database.yml file as necessary for details see Database Configuration.
Then run...cd mysite
..to create and seed the database
4. Start your server
To fire up the default, built-in WEBrick server, just run:wagn server
...and point your browser to http://localhost:3000 (unless otherwise configured).
WEBrick is great for a quick test run, however, for production, you will not want to use the built-in Webrick server; you'll want to use Nginx or Apache:
Wagn in production for more advanced topics.
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
Wagn's mailer setup inherits directly from rails and is configurable in config/application.rb (in Wagn 1.12.6 and later). See the rails documentation on mailer configuration here: