Apache Reverse proxy Server

Source: Internet
Author: User

1 forward proxy : Clients cannot access the external Web directly, they need to set up a proxy server in the same network as the client, and the client accesses the external Web through the proxy server (requires proxy server in the client's browser)

Suitable for:

① Proxy server for LAN (usually gateway, equivalent to Squid's general usage)

② access to a restricted network proxy server, such as education network access to some foreign sites need to find an agent

2 Reverse proxy : The client can access the external Web, but cannot access the target Web, the target Web is located within the network of a machine acting as the target Web proxy, the client direct access to the proxy is like accessing the target Web (the agent is transparent to the client, that is, the client does not have to do how to set Do not know the actual access is only agents, thought is the goal of the visit)

Suitable for:

①IDC a target machine is only open to the internal Web, external clients to access, let another machine to do proxy, external direct access to proxy is equivalent to access the target

②IDC the target machine of a special Web service run on an abnormal port such as 9000, and the firewall is only open to 80, at this time proxy mapping to 9000, external access 80 is equivalent to 9000

Apache Configuration Direction Agent

Operating system is CentOS, about Linux installation Apache is not much to say;

After the Apache installation is complete, go to the/etc/httpd/conf directory and open the httpd.conf file

Then see if the following lines of code are open, and if not, remove the # in front of the code below

LoadModule proxy_module modules/mod_proxy.soloadmodule proxy_connect_module modules/mod_proxy_connect.soloadmodule Proxy_ftp_module Modules/mod_proxy_ftp.soloadmodule Proxy_http_module modules/mod_proxy_http.so

Step Two:

Open the httpd.conf in the/etc/httpd/conf directory and add the following code at the end

<virtualhost *:80>        ServerName www.xxx.cn/platform/share       proxyrequests Off        <proxy *>            Order Deny,allow allow from all        </Proxy>        proxypass/platform/share Http://123.123.123.123/singtec _manager/platform/share       Proxypassreverse/platform/share http://123.123.123.123/singtec_manager/platform/ Share</virtualhost>

Simply say these parameters

    • Www.xxx.cn/platform/share is the domain name used by the server (this can also be the IP address of the server)
    • Proxypass and Proxypassreverse behind the "Http://123.123.123.123/singtec_manager/platform/share" is the real destination server that needs our request, the space in front of it +/ + spaces are also part of our configuration

Step Three:

Restart Apache:service httpd Restart

Thus, when we enter Http://www.xxx.cn/platform/share in the client browser, the page will return http://123.123.123.123/singtec_manager/platform/share this page

Apache Reverse proxy Server

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.