当Mongrel Rails启动时启动和停止另一个进程

时间:2021-01-17 20:42:55

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.

我想在mongrel rails启动时启动另一个进程。有没有办法做到这一点?我希望每次启动rails时启动lighttpd作为我项目中的媒体服务器,并在每次rails停止时停止它。

3 个解决方案

#1


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).

编写一个新的init脚本,以便在启动mongrel集群时启动lighttpd。将其设置为可执行文件并将其放在其他init脚本所在的位置(/etc/init.d/基于Debian的发行版)。

  • Start: Start the mongrel cluster and start lighttpd
  • 开始:启动mongrel集群并启动lighttpd

  • Stop: Stop the mongrel cluster and stop lighttpd
  • 停止:停止杂种群并停止lighttpd

  • Restart: Stop and start
  • 重启:停止并开始

#2


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

不明白为什么你不能将lighttp配置为mongrel集群的反向代理,甚至不能将nginx与乘客一起使用

#3


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?

如果您使用nginx / Apache(我的首选是nginx)来运行您的应用程序,那么为什么您选择的Web服务器不能仅提供静态文件?

#1


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).

编写一个新的init脚本,以便在启动mongrel集群时启动lighttpd。将其设置为可执行文件并将其放在其他init脚本所在的位置(/etc/init.d/基于Debian的发行版)。

  • Start: Start the mongrel cluster and start lighttpd
  • 开始:启动mongrel集群并启动lighttpd

  • Stop: Stop the mongrel cluster and stop lighttpd
  • 停止:停止杂种群并停止lighttpd

  • Restart: Stop and start
  • 重启:停止并开始

#2


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

不明白为什么你不能将lighttp配置为mongrel集群的反向代理,甚至不能将nginx与乘客一起使用

#3


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?

如果您使用nginx / Apache(我的首选是nginx)来运行您的应用程序,那么为什么您选择的Web服务器不能仅提供静态文件?