几个月前,我使用apache,passenger和virtualhost设置了一个rails应用程序,并且我(最终)让一切正常工作。 现在我正在尝试在同一个盒子上托pipe另一个应用程序。 我已经添加了新的虚拟主机(见下面 – app2),并编辑我的主机文件指向托pipeIP(192.xx10),但是当我inputapp2.host.com我得到的app1。 另外,当我浏览到http://192.xx10时,我会自动获取app1。 这是正常的吗?
我的httpd.conf文件如下所示:
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.9 PassengerRuby /usr/bin/ruby1.8 <VirtualHost *:80> ServerName app1.host.com DocumentRoot /var/www/app1/public <Directory /var/www/app1/public> AllowOverride all Options -MultiViews </Directory> ErrorLog /var/log/apache2/error.log </VirtualHost> <VirtualHost *:80> ServerName app2.host.com DocumentRoot /var/www/app2/public <Directory /var/www/app2/public> AllowOverride all Options -MultiViews </Directory> ErrorLog /var/log/apache2/error.log </VirtualHost>
我已经做了很多的研究,我看到的一切似乎都表明我缺less一个NameVirtualHost *:80但是我已经在我的ports.conf文件中包含了这个。
我真的希望有人能帮助我。 我在Ubuntu服务器上。
预先感谢您提供的任何帮助。
检查第二个站点的.htaccess,也许它是覆盖您的虚拟主机configuration,并将networking请求路由到以前的站点。