#apache服务器安装目录
#Listen 12.34.56.78:80
Listen 31001#监听服务器那个端口
# Example:
# LoadModule foo_module modules/mod_foo.so#LoadModule authn_file_module modules/mod_authn_file.soLoadModule authn_dbm_module modules/mod_authn_dbm.soLoadModule authn_anon_module modules/mod_authn_anon.soLoadModule authn_dbd_module modules/mod_authn_dbd.soLoadModule authn_default_module modules/mod_authn_default.soLoadModule authz_host_module modules/mod_authz_host.soLoadModule authz_groupfile_module modules/mod_authz_groupfile.soLoadModule authz_user_module modules/mod_authz_user.soLoadModule authz_dbm_module modules/mod_authz_dbm.soLoadModule authz_owner_module modules/mod_authz_owner.soLoadModule authz_default_module modules/mod_authz_default.soLoadModule auth_basic_module modules/mod_auth_basic.soLoadModule auth_digest_module modules/mod_auth_digest.soLoadModule dbd_module modules/mod_dbd.soLoadModule dumpio_module modules/mod_dumpio.soLoadModule reqtimeout_module modules/mod_reqtimeout.soLoadModule ext_filter_module modules/mod_ext_filter.soLoadModule include_module modules/mod_include.soLoadModule filter_module modules/mod_filter.soLoadModule substitute_module modules/mod_substitute.soLoadModule deflate_module modules/mod_deflate.soLoadModule log_config_module modules/mod_log_config.soLoadModule log_forensic_module modules/mod_log_forensic.soLoadModule logio_module modules/mod_logio.soLoadModule env_module modules/mod_env.soLoadModule mime_magic_module modules/mod_mime_magic.soLoadModule cern_meta_module modules/mod_cern_meta.soLoadModule expires_module modules/mod_expires.soLoadModule headers_module modules/mod_headers.soLoadModule ident_module modules/mod_ident.soLoadModule usertrack_module modules/mod_usertrack.soLoadModule unique_id_module modules/mod_unique_id.soLoadModule setenvif_module modules/mod_setenvif.soLoadModule version_module modules/mod_version.soLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_connect_module modules/mod_proxy_connect.soLoadModule proxy_ftp_module modules/mod_proxy_ftp.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_scgi_module modules/mod_proxy_scgi.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_balancer_module modules/mod_proxy_balancer.soLoadModule mime_module modules/mod_mime.soLoadModule dav_module modules/mod_dav.soLoadModule status_module modules/mod_status.soLoadModule autoindex_module modules/mod_autoindex.soLoadModule asis_module modules/mod_asis.soLoadModule info_module modules/mod_info.soLoadModule cgid_module modules/mod_cgid.soLoadModule dav_fs_module modules/mod_dav_fs.soLoadModule vhost_alias_module modules/mod_vhost_alias.soLoadModule negotiation_module modules/mod_negotiation.soLoadModule dir_module modules/mod_dir.soLoadModule imagemap_module modules/mod_imagemap.soLoadModule actions_module modules/mod_actions.soLoadModule speling_module modules/mod_speling.soLoadModule userdir_module modules/mod_userdir.soLoadModule alias_module modules/mod_alias.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule weblogic_module modules/mod_wl_22.soLoadModule ssl_module modules/mod_ssl.so<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>#如果加载mpm_netware_module模块 就执行里面的内容。
User dcosGroup docker#启用apache 用户和用户组
</IfModule>
</IfModule> ServerAdmin you@example.com#邮件地址
#ServerName www.example.com:80
#DNS name
DocumentRoot "/app/statics"
#静态资源文件路径
#<Directory />
Options FollowSymLinks AllowOverride None Order deny,allow Deny from all</Directory>
<Directory "/app/statics">
Options FollowSymLinks#
# AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None#
# Controls who can get stuff from this server. # 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 "/app/logs/error_log"
ErrorLog "|/app/apache/bin/rotatelogs /app/logs/error_%Y%m%d.log 86400 480"
LogLevel warn
<IfModule log_config_module>
# # The following directives define some format nicknames for use with # a CustomLog directive (see below). # 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 "|/app/apache/bin/rotatelogs /app/logs/access_%Y%m%d.log 86400 480" common # </IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/app/apache/cgi-bin/"
</IfModule>
<IfModule cgid_module>
# # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock logs/cgisock</IfModule>#
# "/app/apache/cgi-bin" should be changed to whatever your ScriptAliased# CGI directory exists, if you have that configured.#<Directory "/app/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all</Directory>#<Directory "/home/macg/www/test">
#Options All 允许对目录的操作,
#ALL---所有操作 AllowOverride all AllowOverride all----允许.htaccess所有指令,
#缺省是all
#AllowOverride None -#完全忽略.htaccess文件
#</Directory>
DefaultType text/plain
<IfModule headers_module>
RequestHeader unset Proxy early</IfModule><IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z AddType application/x-gzip .gz .tgz </IfModule> ErrorDocument 404 /missing.html<IfModule ssl_module>
SSLRandomSeed startup builtin SSLRandomSeed connect builtin</IfModule>ServerSignature Off
ServerTokens ProdTraceEnable Off<Location /> <Limit OPTIONS PUT DELETE> AuthType Basic AuthName "Limit OPTIONS" Require valid-user </Limit></Location>Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://proxy> BalancerMember http://10.186.186.59:31001/ loadfactor=1 route=10.186.186.59 BalancerMember http://10.186.186.60:31001/ loadfactor=1 route=10.186.186.60 ProxySet lbmethod=byrequests stickysession=ROUTEID</Proxy><VirtualHost *:31001>
ProxyPass / balancer://proxy/ ProxyPassReverse / balancer://proxy/</VirtualHost> #<VirtualHost *:80> # ip 加端口 # #文档的根目录 # DocumentRoot "\phpStudy\WWW\cq" # #域名 # ServerName www.cq.com # ServerAlias # #配置rewrite相关选项 # <Directory "\phpStudy\WWW\cq"> # Options FollowSymLinks ExecCGI # #是否启用rewrite # AllowOverride All # Order allow,deny # #是否显示列表 (在发布项目后一般是不启用,对于这个配置,针对DocumentRoot在apachede的默认文件夹外的目录生效。比如下面的例一 ) # Options +indexes # Allow from all # #拒绝所有的访问 # #Deny from all # Require all granted# RewriteRule ^/(cpicweb/view/customer/servingcenter/complaint/AddPropertyInsuranceComplaint.jsp$) http://service.cpic.com.cn/selfComplaints/init [L,R=permanent]
# RewriteRule ^/cpicweb/logoutRedirect(.*)$ http://www.cpic.com.cn? [L,R=permanent]
# </Directory> # </VirtualHost># 设置代理
#Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED#<Proxy balancer://proxy># BalancerMember http://10.186.186.59:31001/ loadfactor=1 route=10.186.186.59# BalancerMember http://10.186.186.60:31001/ loadfactor=1 route=10.186.186.60# ProxySet lbmethod=byrequests stickysession=ROUTEID#</Proxy>