gpt4 book ai didi

apache - URL 无法正确定向

转载 作者:行者123 更新时间:2023-12-04 19:38:10 24 4
gpt4 key购买 nike

我的虚拟主机名有问题。我正在基于 CentOS 的操作系统中设置一个虚拟主机。在主机文件中,我添加了 2 个虚拟主机 URL。我还编辑了 httpd.conf 文件。我添加了虚拟主机目录。我重新启动了 httpd 并在浏览器中打开了 URL。但它不会进入我的页面。它重定向到其他页面。询问主机名。这是我的设置。

在我的 httpd.conf 我有这个:

<VirtualHost *:80>
DocumentRoot /data/APACHE/html/metro
ServerName store6.giftregistry.com.ph
ServerAlias store6.giftregistry.com.ph
<Directory "/data/APACHE/html/metro">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /data/APACHE/html/metro
ServerName store7.giftregistry.com.ph
ServerAlias store7.giftregistry.com.ph
<Directory "/data/APACHE/html/metro">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

在主机文件中,我有这个:
10.128.0.63       store6.giftregistry.com.ph
10.128.0.63 store7.giftregistry.com.ph

我的代码有错误吗?

最佳答案

添加
NameVirtualHost *:80
在上面..

文档:
http://httpd.apache.org/docs/2.2/vhosts/name-based.html

关于apache - URL 无法正确定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25717477/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com