Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Port Proxy

Tags:

I have a non-Apache server listening to port 8001 and Apache listening port 80. I want a certain virtual domain to actually be served by the non-Apache server over port 80.

Example:

<VirtualHost *:80>   Servername example.com    # Forward this on to the server on port 8001 </VirtualHost> 

I thought I could do this with mod_proxy and ProxyPass with something like this.

ProxyPass * http://www.example.com:8001/ 

But that doesn't work.

like image 870
Dave Avatar asked Jul 21 '09 23:07

Dave


People also ask

Does Apache act as a proxy server?

In addition to being a "basic" web server, and providing static and dynamic content to end-users, Apache httpd (as well as most other web servers) can also act as a reverse proxy server, also-known-as a "gateway" server.

What is Apache HTTP proxy?

Apache HTTP Proxy is a proxy service that can be used to distribute updates to client computers. Apache HTTP Proxy performs a similar role to the mirror server feature popular in ERA 5 and earlier. To install Apache HTTP Proxy, read the instructions for Windows, Linux, or Virtual Appliance.

How does Apache support proxy?

Apache Working As A Reverse-Proxy Using mod_proxy Some of these modules are: mod_proxy: The main proxy module for Apache that manages connections and redirects them. mod_proxy_http: This module implements the proxy features for HTTP and HTTPS protocols. mod_proxy_ftp: This module does the same but for FTP protocol.

How does Apache reverse proxy work?

The Apache reverse proxy handles the incoming request, recognizes that an Apache ProxyPassReverse setting exists, and then forwards the request to Tomcat. Then Tomcat handles the request, returns a response to the Apache reverse proxy, and Apache returns the response to the client.


1 Answers

ProxyPass * http://www.example.com:8001/

star is only valid in a block. Forward slash is what you want.

ProxyPass / http://www.example.com:8001/ ProxyPassReverse / http://www.example.com:8001/ 

The reverse proxy ensures that redirects sent by your port 8001 server are adjusted to the canonical name name of your proxy.

The apache manual has some examples. http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

like image 163
txyoji Avatar answered Jan 30 '23 13:01

txyoji