Apache Centos 6 中的多个虚拟主机仅适用于 2 个子域

Apache Centos 6 中的多个虚拟主机仅适用于 2 个子域

您好,以下是 httpd.conf 文件的内容。我在此文件中创建了 5 个子域,其中 2 个子域正在运行。我在虚拟主机后面提到了哪些子域正在运行,哪些子域没有运行

NameVirtualHost *:80
<VirtualHost *:80>
ServerName 88.198.133.25
DocumentRoot "/home/developer/public_html"
<Directory /home/developer/public_html>
Options FollowSymLinks
AllowOverride All
</Directory>


# this is for default acees of apache
# working 


</VirtualHost>
<VirtualHost *:80>
ServerName bioad.log.com
DocumentRoot "/home/developer/public_html/subdomain/bio/bioad"
<Directory /home/developer/public_html/subdomain/bio/bioad>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

#not working

<VirtualHost *:80>
DocumentRoot /home/developer/public_html/gecautonew
ServerName gec.log.com
ServerAlias gec.log.com
<Directory /home/developer/public_html/gecautonew>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

#not working

<VirtualHost *:80>
DocumentRoot /home/developer/public_html/obb/public
ServerName obb.log.com
<Directory /home/developer/public_html/obb/public>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

# working

<VirtualHost *:80>
DocumentRoot /home/developer/public_html/subd/bio/api
ServerName biopi.log.com
<Directory /home/developer/public_html/subd/bio/api>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

#working

<VirtualHost *:80>
DocumentRoot /home/developer/public_html/biouser
ServerName biou.log.com
<Directory /home/developer/public_html/biouser>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>

#not working

我无法确定此配置文件中的实际问题是什么

答案1

根据 apache 版本,您可能需要将 NamedVirtualHost 指令添加到 apache 配置并重新加载 apache。

请确认您已拥有以下内容/etc/httpd/config/httpd.confNameVirtualHost *:80

相关内容