1、静态WEB VirtualHost配置:
<VirtualHost *:80>
DocumentRoot /opt/project/mybaidu
ServerName www.mybaidu.com
ErrorLog logs/www.mybaidu.com-error_log
CustomLog logs/www.mybaidu.com-access_log common
</VirtualHost>
2、动态rewriter方式WEB VirtualHost配置:
<VirtualHost *:80>
ServerAdmin webmaster@mybaidu.cn
DocumentRoot /opt/project/mybaidu
ServerName mybaidu.cn
CustomLog "|/usr/local/sbin/cronolog /opt/proj/log/mybaidu.cn.access_log.%Y%m%d" combined
RewriteEngine on
RewriteRule %{HTTP_HOST} [^.]+\.mybaidu.cn$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule mybaidu.cn(.*) http://192.168.xxx.222:82/mybaidu/$1 [P]
</VirtualHost>