本文共 3551 字,大约阅读时间需要 11 分钟。
LoadModule negotiation_module modules/mod_negotiation.so
#加载代理模块 LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so <IfModule !mpm_netware_module> <IfModule !mpm_winnt_module> User daemon Group daemon </IfModule> </IfModule> ServerAdmin zhangqs008@163.com ServerName 127.0.0.1:80 DocumentRoot "D:/Apache Server 2.2/htdocs" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "D:/Apache Server 2.2/htdocs"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch> ErrorLog "logs/error.log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access.log" common #CustomLog "logs/access.log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "D:/Apache Server 2.2/cgi-bin/" </IfModule> <IfModule cgid_module> </IfModule> <Directory "D:/Apache Server 2.2/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> DefaultType text/plain <IfModule mime_module> TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz </IfModule> <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> #[warn] _default_ VirtualHost overlap on port 80, the first has precedence #是因为第一个虚拟主机配置已经占用了80端口,所以将会沿用第一虚拟主机的配置。 #所以不管你第二个,或者第n个虚拟主机怎么配置,都会沿用第一个虚拟主机的配置,即出现的都是第一个站点的内容。 NameVirtualHost *:80 <VirtualHost *:80> ProxyPreserveHost On ServerName gz.***.com ProxyPass / http://192.168.2.218/ ProxyPassReverse / http://192.168.2.218/ </VirtualHost> <VirtualHost *:80> ProxyPreserveHost On ServerName work.***.com ProxyPass / http://192.168.0.254/ ProxyPassReverse / http://192.168.0.254/ </VirtualHost> <VirtualHost *:80> ProxyPreserveHost On ServerName web.***.com ProxyPass / http://192.168.1.254/ ProxyPassReverse / http://192.168.1.254/ </VirtualHost>转载地址:http://wmolo.baihongyu.com/