Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using an apache webserver which has several applications on it.

I need to restart one specific ruby on rails application.

In the phusion passenger documentation, it mentions that there are 2 ways of doing so:

  1. By restarting Apache.
  2. By creating or modifying the file tmp/restart.txt in the Rails application’s root folder. Phusion Passenger will automatically restart the application during the next request.

For example, to restart our example MyCook application, we type this in the command line:

touch /webapps/mycook/tmp/restart.txt

I don't want to restart the whole webserver, just my rails app. My rails app folder is called sub_interface.

I created an empty text file called restart.txt in the tmp folder and ran the comman

touch htdocs/sub_interface/tmp/restart.txt

Nothing happened. That file is empty.

How do I restart only my rails application without restarting the entire web server?

share|improve this question

migrated from Aug 24 '12 at 1:58

This question came from our site for professional and enthusiast programmers.

There is no need to create the file before issuing the touch command. 'touch' creates an empty file, or if the file exists, it updates the file changed date.

Are you sure httpd.conf is loading the app on htdocs/sub_interface? If so, are you sure passenger didn't restart the app when you created the file tmp/restart.txt?

share|improve this answer
up vote 1 down vote accepted

Nothing happened. That file is empty.

This is what you'd expect - an empty file at ./tmp/restart.txt and no other changes till you try reloading a page. This will restart the app next time you load it, however you may not see refreshed content if (for example) you have enabled caching (page, action or fragment).

To test you are looking at the right folder, cd to sub_interface and do this:

touch ./public/test.txt

Then visit, and check that a blank page (and not a 404 is served).

Then to test that the website is indeed restarting, change an existing action by adding

redirect_to :root and return 

at the start and touch ./tmp/restart.txt again - if you visit the action web page (say and it redirects, you know the restart has worked.

share|improve this answer
Thanks i will try it – Kum Aug 23 '12 at 8:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.