Apache 反向代理配置

1. 修改httpd.conf的module引入
LoadModule proxy_module modules/mod_proxy.so 
LoadModule proxy_http_module modules/mod_proxy_http.sohtml

2. 新建反向代理配置extra/httpd-proxy-reverse.conf
```
<IfModule mod_proxy.c>  
    #Reverse Proxy(反向代理)  
    <Proxy *>  
        Order allow,deny
        Allow from all
    </Proxy>  
  
    ProxyRequests Off  
    #proxy setting  
    ProxyPass /WechatService http://localhost:8900/WechatService
    ProxyPassReverse /WechatService http://localhost:8900/WechatService
  
</IfModule> 
```apache

3.在httpd.conf文件中引入反向代理配置
在最後面加入
```
# module proxy config file 
Include conf/extra/httpd-proxy-reverse.conf
``` 代理

4. "httpd -t"檢查語法,有時候會出現commons-problem
https://httpd.apache.org/docs/current/upgrading.html
例如:Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration.
**須要引入**LoadModule access_compat_module modules/mod_access_compat.soserver

相關文章
相關標籤/搜索