开启模块:
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule xml2enc_module modules/mod_xml2enc.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
开启serverName
ServerName localhost:81
配置反向代理:
<VirtualHost *:81>
ServerName 127.0.0.1:81
ProxyPreserveHost On
ProxyRequests Off
<Proxy balancer://yyaq>
BalancerMember http://127.0.0.1:7101/yyaq
BalancerMember http://127.0.0.1:7102/yyaq
</Proxy> ProxyPass /yyaq balancer://yyaq
ProxyPassReverse /yyaq balancer://yyaq <Proxy balancer://dci>
BalancerMember http://127.0.0.1:7101/dci_lt
</Proxy> ProxyPass /dci_lt balancer://dci
ProxyPassReverse /dci_lt balancer://dci </VirtualHost>
如何从Apache官网下载windows版apache服务器
如果你是做反向代理,建议你别用apachehaus,有坑人的路径问题。我最后用的apache lounge版需要下载vc14运行时(X64)。