我有 2 个网站正在尝试使用 Apache Vhost 进行设置。网站设置在 IP 地址/文件夹名称,但尚未对外暴露,没有 DNS。因此,当我尝试像这样对它们进行 Vhost 时:
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/marion"
ServerName IP-address/marion
<Directory "c:/wamp/www/marion">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/redcreek"
ServerName IP-address/redcreek
<Directory "c:/wamp/www/redcreek">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
并浏览到任一站点,例如IPaddress/redcreek
,我收到错误"The requested URL /redcreek/ was not found on this server."
它就像我激活 Vhost 配置文件后无法识别 IP 地址一样。
httpd-vhosts.conf
在我注册 DNS 名称之前是否可以这样配置?