Apache mod_proxy in Ubuntu

 

Setting up a reverse proxy using Apache in Ubuntu:

1. Install reverse_proxy module

sudo apt-get install libapache2-mod-proxy-html

2. Install libxml if it is not already installed.

apt-get install libxml2-dev

3. Load the modules in apache2.conf file

LoadModule  proxy_module         /usr/lib/apache2/modules/mod_proxy.so
LoadModule  proxy_http_module    /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule  headers_module       /usr/lib/apache2/modules/mod_headers.so
LoadModule  deflate_module       /usr/lib/apache2/modules/mod_deflate.so
LoadFile    /usr/lib/libxml2.so

4. Say you want to forward all requests starting with /foo to http://moo.com then add the following to your apache2.conf file

ProxyPass /foo/  http://moo.com/

5. Bounce Apache and you are good to go.

你可能感兴趣的:(apache,module,ubuntu,up)