Apache's Reverse proxy setting

Source: Internet
Author: User

Work needs, from the same port into the server-side shunt, to perform different port services. Use Apache's reverse proxy function to implement.

①"apache2ctl-m" See if the Proxy module (below ★) is loaded. If not loaded, perform "a2enmod proxy_http" load.

[Email protected]:/etc/apache2/sites-available# apache2ctl-mloaded modules:core_module (Static) So_module ( Static) Mpm_event_module (shared) negotiation_module (shared) proxy_module (shared)        ★proxy_http_module (shared) ★r Ewrite_module (shared) setenvif_module (shared) status_module (shared)

②port 9596 httpd conf file with additional Reverproxy settings

As a prerequisite, ensure that the following files and folders exist

/var/wwwtest_9596/test/index.html

  /var/wwwtest_9596/test/apachetest

 <virtualhost *:9596  > ServerAdmin [ Email protected] documentroot /var/wwwtest_9596/ ####### #追加部分 ###### # #  <ifmodule mod_proxy.c> #Reverse proxy  <proxy * > Order Deny,allow Deny from all to ll  </proxy> proxyrequests Off #proxy setting Proxypa SS /test/apachetest/http:// 127. 0.0.1:80/ proxypassreverse/test/apachetest/http:// 127.0.0.1:80/ </ifmodule> ####### #追加部分 ########</virtualhost> 

③"service apache2 restart", restart the Apache service to allow the above proxy settings to take effect.

④ input the http://serverip:9596/test from the browser, at this point the service is performed under Port 9596.

⑤ input the http://serverip:9596/test/apachetest/from the browser, at this point the service is performed under Port 80. General 80 The default is to open the Apache test page.

In fact, Apache made a replacement http://serverip:9596/test/apachetest/-http://serverip:80/

In fact, if the parameters, it will automatically pass through. Http://serverip:9596/test/apachetest/?u=username&p=password-http://serverip:80/?u=username&p= Password

Apache's Reverse proxy setting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.