设置乘客:代替显示Apache默认页面



我试图让乘客上班,但我一直看到apache默认页面。我在Inmotion VPS上使用CentOS 6.3。这是我到目前为止所做的:

  1. 宝石安装乘客。
  2. rvmsudo乘客安装 - apache2-module
  3. 将以下代码粘贴到/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>

    编辑:不确定为什么这不正确格式化。它在文本编辑器中衬里且列出了。

  4. 在etc/hosts中有一行:

    123.123.123.123 XXXXXX.inmotionhosting.com XXXXXX

  5. 我通过sudo服务重新启动了apache httpd httpd in/etc/init.d

  6. 仍然显示Apache默认页面

有什么想法吗?谢谢

我偶然发现了这个1岁的帖子,出于类似的问题,但评论对我不起作用。因此,我只是为那些寻求帮助的人加2美分。

如果您看到Apache默认页面,则意味着Phusion乘客可能没有运行。启动/停止/重新启动Apache服务器时,您可能已经看到了一条警告消息,该服务器说已经加载了Phusion乘客模块,跳过。

所以Apache跳过了您在Conf File中添加的最新负载模块线。

然后检查目录集中的errir.log,以在Apache配置文件中进行错误log。(Centos的httpd.conf)

就我而言,它抱怨说,它在Pastegengerruby的目录集中找不到看门狗。这证实了加载的乘客模块不是我添加的。这可能发生了,因为我现在正在使用RVM,但在不久前也安装了旧版本的乘客。因此,我查看了apache root下的config.d目录,有一个文件" pastenger.conf",它正在加载乘客的旧版本。

我删除了该文件,保留了新的LoadModule - 从指令phusion乘客中复制给我时,我在安装Apache2模块时给了我,重新启动了Apache服务器,没有警告消息,并且乘客工作了。

最新更新