2016-09-04 29 views
1

我刚刚得到一个新的域名,我试图用它为一个不同的网站,但我不能得到它的工作。它仍然会将我发送给我的其他域名。我试图查找它如何做到这一点,但我找不到做,我该怎么办?下面是代码,我试图用我的其他域名

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> 

回答

0

由于

http://ping.eu/nslookup/

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

在你的情况下删除ServerName ...VirtualHost ...,并在上面

NameVirtualHost *:80 
NameVirtualHost *:8080 

添加如果你也想还达成80端口的第二个域,那么你不需要第二行。

现在从VirtualHost中删除IP,如上面的链接所述,并且您应该到达域。

+0

谢谢@Aleks我起初尝试过,并且因为某些原因没有工作。 –

+0

现在它的话访问禁止 –

+0

它仍然会去我的其他领域,但当我在手机上它去/它不说这个服务器上。 –

相关问题