views:

109

answers:

3

I would like to start another process when mongrel rails starts up. Is there a way to do this? I am looking to start lighttpd which acts as a media server on my project every time rails starts and stop it every time rails stops.

+2  A: 

Write a new init script for starting lighttpd when you start the mongrel cluster. Set it to be executable and place it where your other init scripts reside (/etc/init.d/ on Debian based distributions).

  • Start: Start the mongrel cluster and start lighttpd
  • Stop: Stop the mongrel cluster and stop lighttpd
  • Restart: Stop and start
Tate Johnson
You're right, rather than trying to sneak code into mongrel starting up, I need to write something that starts mongrel + lighttpd and then stops them together. This is the right idea. Thank you.
nixterrimus
A: 

Dont see why you cant configure lighttp as a reverse proxy for a mongrel cluster or even use nginx with passenger

Omar Qureshi
A: 

If you use nginx/Apache (nginx is my preference) to run your app on passenger then why couldn't your chosen web server just serve your static files?

railsninja