Ubuntu Mongrel Installation

These directions are for creating the mongrel cluster on the Ubuntu system. Make sure you have all of the gems installed before you complete the installation. All instructions are for ROOT user or you can sudo all of the commands below. Make sure an either run as root or sudo all commands. I am going to run as root

We will need to install a compiler on the system before you continue.
apt-get install build-essential

You can then install ubuntu software for the mongrel_cluster
apt-get install mongrel-cluster

Now that it is installed we will need to configure each site to have a file located in the /etc/mongrel_cluster folder. here is an example of a configuration
user: www-data
cwd: /var/www/vhost/subdomain.website.com/current
log_file: /var/www/vhost/subdomain.website.com/shared/log/mongrel.log
port: "8000" 
environment: production
group: mongrel
pid_file: /var/www/vhost/subdomain.website.com/shared/pids/mongrel.pid
servers: 3

This will start up 3 mongrels linking to port 8000 in the proxy setup. This should be located in each of the RoR projects in the config folder you will then link each of the files to the folder using a command like this.
ln -s /var/www/vhost/testapp/current/config/mongrel_cluster.yml /etc/mongrel-cluster/sites-enabled/helpdeskapp.yml

You will also need to make sure that the mongrel user has the ability to write to the tmp/, logs/, system/ folders in each project
chown -Rh www-data:www-data /var/www/vhost/APPLICATION/shared/log
chown -Rh www-data:www-data /var/www/vhost/APPLICATION/shared/pids
chown -Rh www-data:www-data /var/www/vhost/APPLICATION/shared/system

Now you will need to change the mod_proxy part in each of the vhost files.
<IfModule mod_proxy_balancer.c>
     <Proxy "balancer://mongrel-cluster">
     ProxyPass / balancer://mongrel-cluster/
     ProxyPassReverse / balancer://mongrel-cluster/
#    ProxyPreserveHost on

Now you can proceed with the web setup and project setup.

To restart the mongrel just run the following:
/etc/init.d/mongrel_cluster restart


Popular posts from this blog

Console over SSH (ONTAP)

Cacti Monitor Server Step by Step Ubuntu

Brocade Zone Setup