首页 > 代码库 > Apache 虚拟主机配置
Apache 虚拟主机配置
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin shaven@163.com
DocumentRoot "C:/data/AppServ/www/a"
ServerName a.com
ServerAlias www.a.com
ErrorLog "logs/dummy-host.a-error.log"
CustomLog "logs/dummy-host.a-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin shaven@163.com
DocumentRoot "C:/data/AppServ/www/b"
ServerName b.com
#子域名泛解析
ServerAlias *.b.com
ErrorLog "logs/dummy-host.b-error.log"
CustomLog "logs/dummy-host.b-access.log" common
</VirtualHost>
#禁止列出目录,删除Indexes
Options Indexes FollowSymLinks
#Apache Rewrite
LoadModule rewrite_module modules/mod_rewrite.so
AllowOverride All #允许任何目录使用“.htaccess”
RewriteEngine on #开启Rewrite模块
Apache 虚拟主机配置