Apache Server 2.2 多站点域名转向配置文件

#ApacheServe配置

#服务器根目录
ServerRoot "D:/Apache Server 2.2" 

#侦听端口
Listen 80
LimitRequestLine 40940
LimitRequestFieldSize 40940


#加载模块
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so 
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so 
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so 
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so 
LoadModule cgi_module modules/mod_cgi.so 
LoadModule dir_module modules/mod_dir.so 
LoadModule env_module modules/mod_env.so 
LoadModule include_module modules/mod_include.so 
LoadModule isapi_module modules/mod_isapi.so 
LoadModule log_config_module modules/mod_log_config.so 
LoadModule mime_module modules/mod_mime.so 

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>
 
上一篇:JAVA数据库连接的另一种实现及简单的数据插入及显示


下一篇:spark运行时出现Neither spark.yarn.jars nor spark.yarn.archive is set错误的解决办法(图文详解)