Apache forward proxy and reverse proxy for Ubuntu (proxypass \ proxypassreverse) The environment is the latest version of ubuntu. The directory structure installed in apache2 has changed. Many articles on the Internet do not apply. Preparation If your originalProgramIf you have any problems, clear them first. Apt-Get -- purge removal apache2apt-get -- purge remove apache2.2-commonapt-Get autoremoveapt-Get -- purge remove APACHE-commonapt-Get -- purg
Today, you configure Apache and Tomcat consolidation on REDHAT5 Linux to forward the address of the JSP page to Tomcat's address.
such as the real JSP address for http://127.0.0.1:8080/jsp/
You can also access it by accessing the http://127.0.0.1/jsp/.
So configure Proxypass in Apache:
proxypass/jsp http://localhost:8080/jsp
However, it was found that there were 503 errors when access was found to be i
. conf:
Listen 80
This indicates that the Apache server listens to all host addresses, including IPv6 addresses. If the original Apache server is configured with some specific listening addresses, make sure these addresses contain the IPv6 addresses used by the proxy server to communicate with the client.
For the proxy server configuration, use the proxypass In the mod_proxy module of the Apache server to add the following configur
uriworkermap.properties, there can be a variety of combinations to meet the requirements of a Web site we have previously proposed. You might as well try it!Http_proxyThis is the use of Apache's own mod_proxy module to connect Tomcat using proxy technology. Make sure you are using the 2.2.x version of the Apache server before you configure it. Because the 2.2.x version of this module has been rewritten, greatly enhanced its functionality and stability.Http_proxy mode is a proxy based on the HTT
files, and static HTML text files. Through the configuration of workers. properties and uriworkermap. properties, there can be a variety of combinations to meet the previous requirements for a web site. Try it!
Back to Top
Http_proxy This is to use the mod_proxy module provided by Apache to connect
own mod_proxy module to connect Tomcat using proxy technology. Make sure you are using the 2.2.x version of the Apache server before you configure it. Because the 2.2.x version of this module has been rewritten, greatly enhanced its functionality and stability.Http_proxy mode is a proxy based on the HTTP protocol, so it requires Tomcat to provide HTTP services, which means that Tomcat's HTTP Connector must be enabled. One of the simplest configurations is as follows
1234
With the increasing of traffic and the demanding of response speed, it is very important to carry out load balancing. The company's system was initially designed to take into account the planning of load Balancing, WWW static server configured Two, because the initial project time is tight, and the traffic is not high, so at that time only used one, the other in the net, just synchronized, and to play a utility. This is a simple test of load balancing.
Let's introduce some of the configuration
rules:
Using Apache as the front-end server of LoadBalance has three different deployment methods:
1) configure a polling balancing policy Go to the conf directory of Apache and openHttpdAdd the. conf file to the end of the file: ProxyPass/Balancer: // Proxy/# Note that the end is "/"
Balancer
: // Proxy>BalancerMember http: // 192.168.6.37: 6888/BalancerMember http: // 192.168.6.38: 6888/ Let's observe the above parameter"
server of loadbalance has three different deployment methods:
1) configure a polling balancing policy
Go to the conf directory of Apache, open the httpd. conf file, and add the following content to the end of the file:
Proxypass/balancer: // proxy/# note that it ends "/"Balancermemberhttp: // 192.168.6.37: 6888/Balancermemberhttp: // 192.168.6.38: 6888/
Let's observe the above parameter "proxypass/balancer
on the HTTP protocol, so it requires Tomcat to provide HTTP services, which means that Tomcat's HTTP Connector must be enabled.Configure Http_proxy1. Resume loading Http_proxy related modulesIn the httpd.conf file, remove the comments from the following linesLoadModule Proxy_module modules/mod_proxy.soLoadModule Proxy_module modules/mod_proxy_ajp.soLoadModule Proxy_balancer_module modules/mod_proxy_balancer.soLoadModule Proxy_http_module modules/mod_proxy_http.soLoadModule Proxy_http_module mod
the backend infrastructure (those servers that actually handle the requests), the design and architecture are insulated and not externally protected; In the case of customers, the reverse proxy server is the only source of all content.The typical implementation is as follows:Reverse Proxy
Related modules
Related directives
Mod_proxy
Proxypass
Mod_proxy_balancer
Balancermember
Use Apache as Web Proxy
The apusic application server can integrate with Apache in the following two ways:4.9.1. HTTP Proxy
The mod_proxy_http module provided by Apache can be used to integrate with the apusic application server, and the apusic application server does not require any settings. Mod_proxy_http provides the proxy HTTP Request function. Supports HTTP/0.9, HTTP/1.0, and HTTP/1.1 standards.
Configuration in standalone EnvironmentPerform the following configuration in % apache_home
System: centos 5.9Environment: apache 2.2.25Tomcat 7.0.42Jdk 1.7.01. Install apacheI am directly installing yum here. If you want to compile and install it, it will not work. The code is as follows:Copy code Yum-y install httpd-devel 2. Install tomcat and jdkI will not talk about it here. You can refer to my article centos installation and configuration of JDK1.7 and Tomcat7.3. Configure httpd proxy anti-proxy tomcatVi/etc/httpd/conf/httpd. confAdd at the bottom The code is as follows:Copy
is rewritten in version 2.2.x, greatly enhancing its functionality and stability.
The http_proxy mode is an HTTP-based proxy. Therefore, Tomcat must provide HTTP services, that is, Tomcat's HTTP ctor must be enabled. The simplest configuration is as follows:
ProxyPass/images!ProxyPass/css!ProxyPass/js!ProxyPass/http
version 2.2.x is used. This module is rewritten in version 2.2.x, greatly enhancing its functionality and stability.
The http_proxy mode is an HTTP-based proxy. Therefore, Tomcat must provide HTTP services, that is, Tomcat's HTTP ctor must be enabled. The simplest configuration is as follows:
ProxyPass /images !ProxyPass /css !ProxyPass /js !
Proxypass/images!
Proxypass/css!
Proxypass/js!
proxypass/http://localhost:8080/
In this configuration, we have all http://localhost request Agent to http://localhost:8080/, this is the address of Tomcat, in addition to images, CSS, JS several directories except. We can also use Mod_proxy to d
With the increasing of traffic and the requirement of response speed, it is necessary to carry out load balancing. The company's system was initially designed to take into account the planning of load Balancing, WWW static server configured Two, because the initial project time is tight, and the traffic is not high, so at that time only used one, the other in the net, just synchronized, and to play a utility. This is a simple test of load balancing.Let's introduce some of the configuration rules
RequireallgrantedProxyPass/http: // 10.0.9.1: 8080/ProxyPassReverse/http: /// 10.0.9.1: 8080/# ProxyPass/ajp: // 10.0.9.1: 8009/# ProxyPassReverse/ajp: // 10.0.9.1: 8009/Requireallgranted
You can choose to use the ajp protocol or httpInstructions on the preceding apache commands:
ProxyPreserveHost {On | Off}: If this function is enabled, the proxy will send the Host: line in the user request message to the backend server, instead of using the server
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.