Apache虚拟主机
开启虚拟主机配置文件
在 httpd.conf 配置文件中 查找 : #Include etc//extra/httpd-vhosts.conf ( 默认是关闭状态 去掉前面 # 则为开启)
开启 httpd-vhosts.conf 后默认 httpd.conf 中的主机配置信息将失效 所有站点需全部在 httpd-vhosts.conf 中设置
httpd-vhosts.conf 文件
NameVirtualHost 192.168.1.3:80
<VirtualHost 192.168.1.3:80>
<Directory "E:\wamp\www\li">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DocumentRoot "E:\wamp\www\li"
ServerName www.li.com
</VirtualHost>
<VirtualHost 192.168.1.3:80>
<Directory "E:\wamp\www\chuang">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DocumentRoot "E:\wamp\www\chuang"
ServerName www.chuang.com
</VirtualHost>
时间: 2024-10-10 23:14:44