RawConnect Wiki > 1.0.5.2 Mongrel

1.0.5.2 Mongrel

From $1

Table of contents
No headers

To deploy your site using mogrel, you will be required to install the ruby gem mongrel and mongrel_cluster.

$ gem install mongrel

$ gem install mongrel_cluster

 To set up your site with Mongrel you will have to complete the fallowing steps:

1- you will have to Modify your httpd.conf. Add a proxy balancer and a virtual host:

       To add a proxy balancer, you must give a name for the proxy balancer, specify the port
       that it will use and you must define it before the virtual host definitions in your httpd.conf file.

Proxy balancer://your_mongrel_cluster>
      BalancerMember http://127.0.0.1:8000/
      BalancerMember http://127.0.0.1:8051/
      BalancerMember http://127.0.0.1:8052/
</Proxy>

Note: you can define as many balance members as you want. we recommend to use 3 and
this could be incremented if you notice that your site is slow.

Add a virtual host with the fallowing sctructure:

<VirtualHost YourIpAddress>
    ServerAlias www.YourDomain.com  YourDmain.com
    ServerAdmin Developers/Getting_Started/Deploying_RawConnect/webmaster@YourDomain.com
    DocumentRoot YourPpath
    ServerName www.YourDomain.com
    ErrorLog logs/YourDomain-error_log
    CustomLog logs/YourDomain-access_log common
    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/([^.]+)$ balancer://your_mongrel_cluster%{REQUEST_URI} [P,QSA,L]
   <IfModule !mod_disable_suexec.c>
         SuexecUserGroup  YourUser YourGroup
    </IfModule>
   <Directory YourPath >
      AllowOverride All
      Options ExecCGI FollowSymLinks -Multiviews
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

httpd.conf Ex. for mongrel_cluster and Virtual Host:

          mongrel_cluster:myraw_cluster
          domain: myraw
          ip: 192.168.1.1
          user: test
          group: test

 Proxy balancer://myraw_cluster>
      BalancerMember http://127.0.0.1:8000/
      BalancerMember http://127.0.0.1:8051/
      BalancerMember http://127.0.0.1:8052/
</Proxy>

<VirtualHost 192.168.1.1>
    ServerAlias wwwmyraw.com myraw.com
    ServerAdmin Developers/Getting_Started/Deploying_RawConnect/webmaster@myraw.com
    DocumentRoot /home/test/public_html/rawconnect/public/
    ServerName www.myraw.com
    ErrorLog logs/myraw.com-error_log
    CustomLog logs/myraw.com-access_log common
    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/([^.]+)$ balancer://myraw_cluster%{REQUEST_URI} [P,QSA,L]
   <IfModule !mod_disable_suexec.c>
         SuexecUserGroup  test test
    </IfModule>
   <Directory /home/test/public_html/rawconnect/public/>
      AllowOverride All
      Options ExecCGI FollowSymLinks -Multiviews
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

After setting up the Virtual Host in httpd.conf file you must restart your apache service. you can restart your apache service writing this code from your terminal:

$ service httpd restart

 

Note: you must modify the httpd.conf as a root user.

2-The next step is to  create the mongrel_cluster.yml. To create this file you will have write this command in from your terminal :

$cd /home/youruser/public_html/rawconnect

$ mongrel_rails cluster::configure

This instruction will create the file config/mongrel_cluster.yml

You must edit this file to look like this:

---
user: test
cwd: /home/test/public_html/rawconnect/
log_file: log/mongrel.log
port: "8000"
environment: production
group: test
address: 127.0.0.1
pid_file: tmp/pids/mongrel.pid
servers: 3

Note: you must run the mongrel commands from the rawconnect home directory with the correspondent user, you should not run this as a root user.


3-After you have modify your httpd.conf and you create the mongrel_cluster.yml, you can run mongrel from your terminal. write this code in your terminal.

         $ cd /home/YourUser/public_html/rawconnect

         $ mongrel_rails cluster::start --clean

Note: you can check the log files at logs  log/mongrel*.log

if you need to stop your mongrel, you can do it writing this from your terminal:

  $ mongrel_rails cluster::stop --clean

     or you can also restart your mongrel

$ mongrel_rails cluster::restart --clean


Note: you must run the mongrel commands from the rawconnect home directory with the correspondent user, you should not run this as a root user.

 

It is really easy to deploy your RawConnect Open Social Software using Mongrel. If you have any question about how to deploy your site, you can post it in our forums at http://www.rawconnect.com/forums .
Tags:
 
Images (0)
 
Comments (0)
You must login to post a comment.