![]() |
While mongrel is offered and supported, mod_rails is the recommended approach for deploying your Ruby on Rails applications on the eApps Hosting service |
[webadmin@example ~]$ cd /home/webadmin/example.com/html/newapp/ [webadmin@example newapp]$ mongrel_rails start -p 3000 -e production -d |
[webadmin@example html]$ cd /home/webadmin/example.com/html/my1stapp [webadmin@example my1stapp]$ mongrel_rails start -p 3001 -e production -d |
[root@example ~]# cd /etc/sysconfig/ [root@example sysconfig]# vi rubyapps |
/home/webadmin/example.com/html/newapp/ 3000 production /home/webadmin/example.com/html/my1stapp/ 3001 production |
[root@example sysconfig]# cd /etc/init.d [root@example init.d]# wget http://repo.eapps.com/rails/rubyapps --10:12:32-- http://repo.eapps.com/rails/rubyapps Resolving repo.eapps.com... 69.89.14.200 Connecting to repo.eapps.com|69.89.14.200|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5326 (5.2K) [text/plain] Saving to: `rubyapps' 100%[=======================================================>] 5,326 --.-K/s in 0.003s 10:12:32 (1.98 MB/s) - `rubyapps' saved [5326/5326] [root@example init.d]# ll rubyapps -rw-r--r-- 1 root root 5326 Mar 27 2009 rubyapps [root@example init.d]# chmod 755 rubyapps [root@example init.d]# ll rubyapps -rwxr-xr-x 1 root root 5326 Mar 27 2009 rubyapps [root@example init.d]# /sbin/chkconfig --level=3 rubyapps on [root@example init.d]# service rubyapps start|stop|restart|status (these are the commands to start, stop, restart and show the status of the mongrel_rails service) |
![]() |
This is just one example of one way to accomplish HA using Ruby on Rails and mod_proxy_balancer. Please consult the official Ruby on Rails and mod_proxy_balancer documentation and other online examples for more information. mod_proxy_balancer is a complex application, so be prepared to do a fair amount of research, reading and testing to get things working correctly. |
[webadmin@example html]$ cd /home/webadmin/example.com/html/my1stapp/ [webadmin@example my1stapp]$ mongrel_rails stop [webadmin@example my1stapp]$ cp -pR /home/webadmin/example.com/html/my1stapp /home/webadmin/example.com/html/my1stapp-2 (this should be on one line, with the space between my1stapp and /home) |
![]() |
If for some reason you fail to stop the already running Mongrel instance for the original application (or if you just don't want to produce downtime for your currently running application) please make sure you delete the log/mongrel.pid file from the new directory (in this case /home/webadmin/example.com/html/my1stapp-2/ , the path is relative to this directory) after the copy process is complete. |
[webadmin@example my1stapp]$ cd /home/webadmin/example.com/html/my1stapp/ [webadmin@example my1stapp]$ mongrel_rails start -p 3000 -e production -d [webadmin@example my1stapp]$ cd /home/webadmin/example.com/html/my1stapp-2/ [webadmin@example my1stapp-2]$ mongrel_rails start -p 3001 -e production -d |