The Hitchhiker’s Guide to Ruby On Rails Galaxy

Records of my voyage through RoR Galaxy

Steps to Restart a Server on a Linux (ubuntu) Box for Rails, Mongrel and Merb stack

Posted by arjunghosh on April 15, 2008

Actually the title should read as

“Restarting Rails, Merb (a file upload framework) and Mongrel (a lightweight Web Server) Cluster”

Well this is also more of a reminder to self. So here goes the steps as follows:

Step 1: First connect to the Box, where the application is running, using any telnet application like Putty. It can be downloaded from this page. You need to put in the login credentials. For example login: vivanista and its password.

Step 2: Then you need to go to the ‘app’ folder. The command to write at cmd line is:-

cd app

Step 3: Then You need to update the application folder with the latest files from SVN repository.The command to write at cmd line is:-

svn update

Step 4: NOw we need to kill the Mreb process which is running on the server. For that we need to find the Mreb’s process id using the ‘grep’ cmd. The command to write at cmd line is:-

ps ax|grep merb

Step 5: Now you get the process ids i.e. pids of the Mreb you need to kill before restart. You need to kill the pid which has ruby folder as its initial folder in the text. The command to write at cmd line is:-

kill -9 (here the Merb pid to kill)

Step 6: Again run the ‘grep’ cmd of Step 4 to check if the Merb process has been killed properly

Step 7: Now restart Mongrel Cluster.(Note: Advantage of using cluster instead of single instance mongrel server is that it helps in load balancing and hence better performance of the server).The command to write at cmd line is:-

mongrel_rails cluster::restart

Step 8: Then go to the merbuploader folder to restart Merb. So you will be in ‘/app/merbuploader /’. To go ‘merbuploader’ folder, the cmd is:-

cd merbuploader

Step 9: Now to restart Merb, the cmd is:-

merb -d

Step 10: Now to exit the server and putty application, the cmd is:-

exit

One Response to “Steps to Restart a Server on a Linux (ubuntu) Box for Rails, Mongrel and Merb stack”

  1. Good idea.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: