Tuesday, April 15, 2008

Forwarding proxy with Apache

Edit prx.confwith the next Apache directives and adapt it to your port and directory requirements:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so

Listen 8887

ProxyRequests On
#put < and > to the next directive
Proxy *
Order Deny,Allow
Deny from all
Allow from 10.0.0.0/24
#put < and > to the next directive
/Proxy

LogLevel warn
CustomLog /home/randradas/prx/access.log combined
ErrorLog /home/randradas/prx/error.log
PidFile /home/randradas/prx/apache.pid


Run the proxy with as normal user:

$ /usr/sbin/apache2 -f prx.conf


And then connect to the proxy from your http client, the server is listening in the 8887 port.

0 comments: