Ubuntu 11.04
Sponsored Link

Enable proxy_http2011/05/04

  Foward requests to another web server by mod_proxy. This means configuring Web server as a revers proxy.

(1) www.srv.world
[10.0.0.31]
- Web Server #1

(2) mail.srv.world
[10.0.0.32]
- Web Server #2


This example set servers to (1) that requests to Web server (1) forward to under /test on webserver (2)

[1] Enable proxy_http
root@www:~#
a2enmod proxy proxy_http

Enabling module proxy.
Considering dependency proxy for proxy_http:
Module proxy already enabled
Enabling module proxy_http.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@www:~#
vi /etc/apache2/mods-enabled/proxy.conf


# 13-19: uncomment and change like follows

ProxyRequests On
<Proxy *>
    AddDefaultCharset off
    Order deny,allow
#     Deny from all
#     #Allow from .example.com
   
Allow from all

</Proxy>
[2] Configure for forwarding
root@www:~#
vi /etc/apache2/sites-available/default


# add these lines

<Location /proxy>

ProxyPass http://mail.srv.world/test

ProxyPassReverse http://mail.srv.world/test

</Location>

</VirtualHost>

root@www:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
... waiting ...done.
[3] Access to /proxy. Web server (2) replys as a following screen.
 
Matched Content