首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我正在尝试使用我的另一个域名

我正在尝试使用我的另一个域名
EN

Stack Overflow用户
提问于 2016-09-04 16:02:57
回答 1查看 26关注 0票数 1

我刚刚得到了一个新的域名,我试图使用它为不同的网站,但我不能让它工作。它仍然会将我发送到我的另一个域名。我试着去查该怎么做,但是我找不到办法,我该怎么办?这是代码,

代码语言:javascript
复制
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>
EN

回答 1

Stack Overflow用户

发布于 2016-09-04 16:20:22

作为

http://ping.eu/nslookup/

代码语言:javascript
复制
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 ...,然后在顶部添加

代码语言:javascript
复制
NameVirtualHost *:80
NameVirtualHost *:8080

如果您还想在端口80上访问第二个域,那么您不需要第二行。

现在从VirtualHost中删除IP,就像上面描述的链接一样,看吧,你应该到达域了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39314810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档