Apache 反向 Proxy設定

來源:互聯網
上載者:User

標籤:style   blog   http   color   strong   os   

環境:

Debian7.5 + apache2.2.24(wdcp/wdlinux)

1、轉至apache源碼包的proxy目錄:

cd /v/softs/lanmp/httpd-2.2.24/modules/proxy

2、執行apxs命令,編譯得到mod_proxy.so:

sudo /www/wdlinux/apache/bin/apxs -c -i -a mod_proxy.c mod_proxy_connect.c mod_proxy_http.c proxy_util.c

  #命令完成後會自動在apache/modules目錄下建立mod_proxy.so檔案

  #並自動在 httpd.conf 中添加 LoadModule proxy_module modules/mod_proxy.so
  

3、在httpd.conf中手工添加:

LoadModule proxy_http_module modules/mod_proxy.so

4、虛擬機器主機設定:

<VirtualHost *:80>  ServerAdmin [email protected]  ServerName test.netmtg.com  ProxyRequests Off  <Proxy *>    Order deny,allow    Allow from all  </Proxy>  ProxyPass /test http://127.0.0.1:9999/testproxy  ProxyPassReverse /test http://127.0.0.1:9999/testproxy</VirtualHost>

5、測試

  瀏覽器中訪問 http://test.netmtg.com/test

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.