Apache配置虚拟主机

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache配置虚拟主机相关的知识,希望对你有一定的参考价值。

#IncludeOptional "D:/wamp/vhosts/*"
Include "D:/wamp/alias/*"


####配置虚拟主机
NameVirtualHost *:80
<VirtualHost *:80>
    ServerName  localhost
    DocumentRoot "D:/www"
</VirtualHost>

<Directory "D:/www" >
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>



NameVirtualHost *:80
<VirtualHost *:80>
    ServerName  www.a.com
    DocumentRoot "D:/www/aaa/test/app"
</VirtualHost>

<Directory "D:/www/aaa/test/app" >
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName  www.mdata.com
    DocumentRoot "D:/www/data"
</VirtualHost>

<Directory "D:/www/data" >
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

 

以上是关于Apache配置虚拟主机的主要内容,如果未能解决你的问题,请参考以下文章

配置apache虚拟主机

apache开启虚拟主机 并进行配置

如何在apache 配置虚拟目录

apache2.4配置虚拟主机

apache虚拟机配置步骤和修改访问端口

虚拟主机的部署(Apache)