修改httpd.conf文件
(1) 配置访问目录的权限
<Directory "F:/webroot/server110">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
(2) 域名配置
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1:80>
DocumentRoot F:/webroot/server110
ServerName www.server110.com
ErrorLog F:/logs/server110/error.log
CustomLog F:/logs/server110/access.log
RewriteEngine on
RewriteCond %{HTTP_HOST} ^server110.com #访问ab.com跳到www.server110.com 地址重写
RewriteRule ^(.*)$ http://www.server110.com$1 [R=permanent,L]
</VirtualHost>
(3) 代理配置
启动以下功能模块
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
配置二级域名
<VirtualHost 127.0.0.1:80>
DirectoryIndex index.htm
ServerName bbs.server110.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1/bbs/
ProxyPassReverse / http://127.0.0.1/bbs/
ErrorLog F:/logs/server110/error.log
CustomLog F:/logs/server110/access.log
</VirtualHost>