我正在尝试使用 2 个虚拟主机设置我的 apache:
Listen 11.22.33.44:8080
<VirtualHost *>
ServerName servername.com/stable
DocumentRoot /home/deploy/producao/servername.com/current/public
<Directory /home/deploy/producao/servername.com/current/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
<VirtualHost *>
ServerName servername.com/stable
DocumentRoot /home/deploy/teste/servername.com/current/public
<Directory /home/deploy/teste/servername.com/current/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
但一切都错了。我想要的是,当我键入 servername.com/stable 时,我得到一个文档根目录,而当我使用 servername.com/testing 时,我得到另一个文档根目录。
我尝试了几件事,但没有奏效,比如
<VirtualHost servername.com/stable>
<VirtualHost servername.com/testing>
并使用
ServerName servername.com
ServerPath /stable
...
ServerName servername.com
ServerPath /testing
但这些都不起作用。