2014-04-15 10:02:01
来 源
ITJS.CN
Apache
本文介绍Apache2域名配置转载,希望对于初学Apache服务器相关的朋友有帮助,更多Apache安装、配置、报错处理等资源请本站内搜索。
配置apache2.2 网站域名

修改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>

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。