终于算是走完部署流程了,但重新启动 Nginx 时出现如下警告:
nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
Stopping nginx: [ OK ]
Starting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable (/usr/lib/ruby/gems/1.8/gems/passenger-3.0.12/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'passenger_root' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'passenger_root' directive, whichever is applicable. (-1: Unknown error)
虽然有警告,但是 Nginx 服务已经启动,通过netstat -anlp|grep 80
可以查看到结果:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4574/nginx
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 4574/nginx
接着访问时出现 403 Forbidden 错误。网上可能是由于不允许访问目录导致的,但我参考的是 ruby-china 的wiki,应该不会有问题。实在想不出来哪个环节出问题,大家帮忙瞧瞧?
系统环境是 CentOS6.4, 通过 yum 安装的 passenger,参考的是 passenger 的官方文档:http://www.modrails.com/documentation/Users%20guide%20Nginx.htmlpassenger3,但安装完成后,,默认安装的是 /etc/nginx/conf.d/passenger.conf文件中passenger_root的默认路径为/usr/lib/ruby/gems/1.8/gems/passenger-3.0.12
, 但进入这个目录看,发现里面也有passenger-4.0.41
,开始使用 3 不行,换成 4 也不行。在其中将 passenger_ruby 改为系统安装的ruby2.0.0
版本路径。
请问这大概是什么问题?
测试网址: www.bebety.com