部署 使用 passenger-install-nginx-module 安装 nginx 后无法使用 nginx

xhmcom · 2016年01月01日 · 最后由 ch3n 回复于 2016年01月03日 · 2880 次阅读

准备在阿里云上用 nginx+passenger 部署 ruby。 我的服务器是 centos7 的,按照教程使用

rvmsudo gem install passenger

安装 passenger 后,用

rvmsudo passenger-install-nginx-module

完成了 nginx 安装 但完成以后,还是会出现 nginx command not found 用 whereis 找 nginx 也找不到 请问一下这是什么原因,还有需要怎么操作才能成功部署

推荐用 passenger 的 standalone 模式 1) gem install passenger 2) passenger start 3) 用 nginx 去反代 passenger

生产环境不推荐使用 standalone nginx 由于不能动态加载 module,passenger-install-nginx-module 安装的 nginx 我记得在 /usr/local/etc/nginx 目录下

默认安装到/opt 目录下,你估计忘了建软链接,应该自己手动建立软链接到/usr/bin 下

https://ruby-china.org/wiki/mac-nginx-passenger-rails 你看看,是否在步骤二的时候选择了/opt/nginx 路径

#2 楼 @kingwkb 并没有任何依据证明生产环境不能用 standalone 模式,甚至直接用 passenger 开 80 端口提供服务也没问题,毕竟 passenger 里面内置了 nginx.

推荐使用他们的 yum 源来安装

#5 楼 @ch3n 不能用和不推荐用,这样传话真不好,去看看官方文档吧

#7 楼 @kingwkb 我也想知道为什么不推荐。 thin/puma/unicorn等都是反代,而且脚本语言大多数都用反代。

https://www.phusionpassenger.com/library/indepth/integration_modes.html#the-modes-explained 不好意思,的确没有不推荐,我记错,这里意思应该是 不是首选吧

Standalone mode We recommend this mode for use during development. That said, this mode is also fit for production.

需要 登录 后方可回复, 如果你还没有账号请 注册新账号