【IT168 服务器学院】./configure --prefix=/apache2 --with-mpm=worker --with-apr-util=/usr/local/apr-util/bin/ --enable-so --enable-authnz-ldap --enable-ldap --enable-proxy --enable-proxy-ajp --enable-proxy-ftp --enable-proxy-http --enable-proxy-balancer --enable-cache --enable-disk-cache --enable-mem-cache
(此配置方法开启了LDAP验证以及proxy和cache)
转发配置
<Location /MetaLogic2/>
ProxyPass http://192.168.168.239:9080/MetaLogic2/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
代理配置
ProxyRequests on
ProxyRemote * http://192.168.168.251:8080
负载均衡
<Proxy balancer://myCluster>
BalancerMember ajp://localhost:8009
BalancerMember ajp://example.org:8009
</Proxy>
<Location /examples/>
ProxyPass balancer://myCluster/examples/
</Location>
cache用法
<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
CacheRoot /usr/local/httpd/cache
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3
</IfModule>
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 4096
MCacheMaxObjectCount 100
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048
</IfModule>
# When acting as a proxy, don''t cache the list of security updates
CacheDisable http://security.update.server/update-list/
</IfModule>