我有一个Apache服务器,我在本地主机上运行。 根http://localhost应该去一个VirtualHost应用程序(Joomla!),而我想要http://localhost/test去第二个VirtualHost – 一个简单的index.htmltesting文件。 我相信我想为此用户mod_rewrite,所以我已经安装。
我有以下两个VirtualHosts定义(我使用Ubuntu 11.04):
根
<VirtualHost localhost> ServerAdmin webmaster@localhost ServerName localhost DocumentRoot /srv/joomla </VirtualHost>
testing
<VirtualHost localhost> ServerName localhost DocumentRoot /srv/test ServerPath /test/ RewriteEngine On RewriteRule ^(/test/.*) /srv$1 </VirtualHost>
但是,当我去http://localhost/test/index.html甚至http://localhost/test我得到一个404 。 我究竟做错了什么? 谢谢!
单声道项目有大量的文件设置。 特别是他们build议使用Alias指令和Location块
Alias /test "/usr/share/doc/xsp/test" MonoApplications "/test:/usr/share/doc/xsp/test" <Location /test> SetHandler mono </Location>
您不能定义2个相同的虚拟主机,他们需要不同的服务器名称
将你的confs合并成一个文件(你可能想要的),或者在不同的端口上运行它们,或者给它们不同的名字