Lighttpd + FastCGI + Rails的部署笔记
具体的安装步骤就不重复说了,相关的资料一大把。
但是怎么样把Rails应用跑起来,我还折腾了一番,最后发现linux下的权限引起的。
我在Ubuntu下遇到的问题是Ligttpd可以启动,可以具体的rails应用却没有起来,可以
ps-ef|grepfcgi看看fastcgi进程是否起动了。
server.modules = ( "mod_access", "mod_fastcgi", "mod_rewrite", "mod_accesslog" ) server.document-root = "/home/qichunren/code/demo/public" server.port=8888 # web server端口 server.error-handler-404 = "/dispatch.fcgi" server.errorlog = "/home/qichunren/code/demo/log/error.log" accesslog.filename = "/home/qichunren/code/demo/log/access.log" fastcgi.server = (".fcgi" => ("localhost" => ("min-procs" => 10, "max-procs" => 10, "socket" => "/home/qichunren/code/demo/tmp/sockets/rails.socket", "bin-path" => "/home/qichunren/code/demo/public/dispatch.fcgi" ) ) )
#!/bin/sh case "$1" in start) /usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf > /dev/null 2>&1 ;; stop) killall lighttpd ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: lighttpd.sh {start|stop|restart}" ;; esac exit 0
我启动了10个fcgi进程,这10个fcgi进程是由Lighttpd服务器启动的时候顺带启动的,不用我们来启动,这里有里有一个技巧,就是重启webserver的时候不用关掉Lighttpd,而是将fcgi进程都kill掉,Lighttpd会自动监视fcgi进程的,看到没有了就会再次启动fcgi进程,所以一个shell就可以搞定重启:
#!/bin/bash ps aux | grep dispatch.fcgi | egrep -v grep | awk '{print $2}' | xargs kill -9
相关推荐
wl00 2020-10-28
EricNet 2020-07-05
EricNet 2020-05-27
何志文 2020-05-11
JOO 2020-04-26
happyfreeangel 2020-04-09
Poisedflw 2020-03-23
yangliuhbhd 2020-03-06
Ben的程序员生涯 2013-06-01
chenshuixian 2013-06-01
wes0 2014-05-31
mrice00 2019-12-20
EricNet 2019-12-11
89304896 2019-12-08
lihaoningxia 2013-07-09
userguanguan 2015-03-16