我刚刚得到了一个新的域名,我试图使用它为不同的网站,但我不能让它工作。它仍然会将我发送到我的另一个域名。我试着去查该怎么做,但是我找不到办法,我该怎么办?这是代码,
ServerName dstokesncstudio.org
<VirtualHost 69.132.203.191:80>
ServerName dstokesncstudio.org:80
ServerAlias www.dstokesncstudio.org
DocumentRoot "C:/htdocs/www/dstokesncstudio"
DirectoryIndex index.html
TransferLog "C:/htdocs/www/dstokesncstudio/logs/access.log"
ErrorLog "C:/htdocs/www/dstokesncstudio/logs/error.log"
<Directory "C:/htdocs/www/dstokesncstudio">
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
ServerName dejesusconstruction.com
<VirtualHost 69.132.203.191:8080>
ServerName www.dejesusconstruction.com:8080
ServerAlias www.dejesusconstruction.com
DocumentRoot "C:/htdocs/www/dstokesncstudio/jesus"
DirectoryIndex index.html
<Directory "C:/htdocs/www/dstokesncstudio/jesus">
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 69.132.203.191:80>
ServerName dstokesncstudio.org
</VirtualHost>
<VirtualHost 69.132.203.191:8080>
ServerName dejesusconstruction.com
</VirtualHost>发布于 2016-09-04 16:20:22
作为
说
dstokesncstudio.org => 216.239.38.21,216.239.32.21,...
dejesusconstruction.com => 216.239.38.21,216.239.32.21,...不是69.132.203.191
我认为您想要基于名称的虚拟主机https://httpd.apache.org/docs/2.4/vhosts/name-based.html
在您的示例中,从VirtualHost ...外部删除ServerName ...,然后在顶部添加
NameVirtualHost *:80
NameVirtualHost *:8080如果您还想在端口80上访问第二个域,那么您不需要第二行。
现在从VirtualHost中删除IP,就像上面描述的链接一样,看吧,你应该到达域了。
https://stackoverflow.com/questions/39314810
复制相似问题