代码之家  ›  专栏  ›  技术社区  ›  Ganesh Shankar

默认页面错误

  •  1
  • Ganesh Shankar  · 技术社区  · 16 年前

    几天前我问过这个关于服务器故障的问题,但没有得到任何回应,也没什么兴趣。因为它与建立一个开发环境有关,所以我想SO社区也许可以帮助我。。。


    我刚刚在OSX上安装了Passenger和Passenger Pref窗格。然而,当我尝试浏览到我的一个Rails应用程序时,我只得到了默认的Apache“it works!”第页。

    我已经检查了vhost的定义,它们看起来还可以,所以我似乎无法找出哪里错了。。。我试过重新安装passenger和pref窗格,并重新启动apache,但没有效果。

    有人知道怎么修吗?

    我的vhost定义如下:

    <VirtualHost *:80>
      ServerName boilinghot.local
      DocumentRoot "/Users/ganesh/Code/boilinghot/public"
      RailsEnv development
      <Directory "/Users/ganesh/Code/boilinghot/public">
        Order allow,deny
        Allow from all
      </Directory>
    </VirtualHost>
    
    2 回复  |  直到 16 年前
        1
  •  1
  •   Shripad Krishna    16 年前

    它应该包含以下内容:

    Include /private/etc/apache2/other/*.conf
    #Include /private/etc/apache2/passenger_pane_vhosts/*.conf
    
    LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so
      PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.11
      PassengerRuby /usr/local/bin/ruby
    
    <IfModule passenger_module>
     NameVirtualHost *:80
      <VirtualHost *:80>
           ServerName _default_
      </VirtualHost>
      Include /private/etc/apache2/passenger_pane_vhosts/*.conf
    </IfModule>
    # Added by the Passenger preference pane
    # Make sure to include the Passenger configuration (the LoadModule,
    # PassengerRoot, and PassengerRuby directives) before this section.
    

    你必须发表评论 #Include /private/etc/apache2/passenger_pane_vhosts/*.conf 把它粘贴到 <IfModule ....... > 阻止。 这对我很有用。

        2
  •  1
  •   como eStas    15 年前

    我也有类似的问题。在我禁用默认页面后解决了这个问题:

    sudo a2dissite 000-default
    sudo /etc/init.d/apache2 reload