【发布时间】:2012-10-06 21:01:40
【问题描述】:
我试图让乘客工作,但我一直看到 apache 默认页面。我在 Inmotion VPS 上使用 centos 6.3。这是我到目前为止所做的:
- gem 安装乘客。
- rvmsudo 乘客安装 apache2 模块
-
将以下代码粘贴到 /usr/local/apache/conf/includes/post_virtualhost_global.conf 中(这会加载到 httpd.conf 中)
LoadModule passenger_module /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17/ext/apache2/mod_passenger.so PassengerRoot /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17 PassengerRuby /home/username/.rvm/wrappers/ruby-1.9.3-p194/ruby<VirtualHost 123.123.123.123:80> ServerName http://XXXXXX.inmotionhosting.com # !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /home/username/rails/current/public <Directory /home/username/rails/current/public> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews </Directory> </VirtualHost>编辑:不确定为什么格式不正确。它在文本编辑器中的衬里和标签很好。
-
在 etc/hosts 中有一行:
123.123.123.123 XXXXXX.inmotionhosting.com XXXXXX 我通过 /etc/init.d 中的 sudo service httpd restart 重新启动了 apache
- 仍然显示 apache 默认页面
有什么想法吗?谢谢
【问题讨论】:
-
检查 apache 服务器访问日志以查看传入请求。检查 catalina 日志(或其他日志)以查看是否存在任何挥之不去的错误。
-
可能你需要启用站点,尝试运行:sudo a2ensite
然后:sudo service httpd reload
标签: ruby-on-rails-3 apache centos passenger