How to configure the Apache proxy service

Source: Internet
Author: User
Tags builtin apache log

Sometimes, it is necessary to deploy multiple websites under the same domain name, access to the external unified portal, but different programs, listening ports are different, if the need for unification, you need to do proxy. The following is a detailed introduction, Apache Proxy service configuration method, in addition, you can also use Ngix agent.


First, install Apache server; (slightly)

Second, configure the Apache agent service parameters;

1. Open the Apache server icon in the lower right corner.

2. Click Open as shown, select Apache2.2, click Stop to stop Apache service;

3, look for the Apache program installation directory, my directory is:

4. Open the Conf folder, locate the following httpd.conf file, and open it with Notepad:

5. Open this file: find

Change the port number after listen to: 80; I have set it up here for 80 ports;

6, comment out the Apache log function;

Find Customlog "Logs/access.log" common in front of it with "#" comment out this function;

7, remove the following related comments:

#LoadModuleproxy_module modules/mod_proxy.so

#LoadModuleproxy_ajp_module modules/mod_proxy_ajp.so

#LoadModuleproxy_balancer_module modules/mod_proxy_balancer.so

#LoadModuleproxy_connect_module modules/mod_proxy_connect.so

#LoadModuleproxy_ftp_module modules/mod_proxy_ftp.so

#LoadModuleproxy_http_module modules/mod_proxy_http.so

#LoadModulestatus_module modules/mod_status.so

Find the appropriate content, remove the previous "#";

8. Remove the following generated code:

<IfModulessl_module>

Sslrandomseedstartup Builtin

Sslrandomseedconnect Builtin

</IfalHost>

9. Add the following code at the end of the file:

Loadmoduleproxy_module modules/mod_proxy.so

Loadmoduleproxy_http_module modules/mod_proxy.so

Namevirtualhost*:80

<VirtualHost*:80>

Proxyrequestsoff

<Proxy*>

Orderdeny,allow

Allowfrom All

</Proxy>

proxypass/http://127.0.0.1:8086/

proxypassreverse/http://127.0.0.1:8086/

</VirtualHost>

Be sure to remember to modify:

proxypass/http://127.0.0.1:8086/

proxypassreverse/ http://127.0.0.1:8086/

"http://127.0.0.1:8086/" for the address and port number you want to point to the server;

1 , if Tomcat Server and Apache server on the same computer, you only need to change the port number to Tomcat the port number can be;

2 , if Tomcat Server and Apache when the server is on a different computer, you need to modify 127.0.0.1 to be Tomcat Server's IP address, the port number is Tomcat the port number of the server.

10, restart the Apache server can be effective;

11. Then, directly access the IP address of the Apache server. If the host IP address of the configuration Apache server is: 192.168.1.200; access to http://192.168.1.200/ can directly open the Public Security Terminal homepage;

Note: Environment configuration description;

1, in order to solve the system in use, public security port port number is a non-80 port number, now through the Apache proxy way, so that users do not need to enter the port number can directly access this Web server;

2, this method can solve the user does not need to enter the port number can access the Web server, but the location of the virtual directory in Tomcat

3, if the operating system has IIS services installed, if not used, then first stop off, because Apache to use 80 ports, and IIS occupies 80 ports;

(The way to stop is to open the service and find the WWW service stopped)



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

How to configure the Apache proxy service

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.