A Blog about technology, linux, peer2peer, cool new downloads and software development.

Saturday, June 20, 2009

apache mod_proxy how to


Links :
-------
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
http://apache.webthing.com/mod_proxy_html/ --> http://www.apachetutor.org/admin/reverseproxies

Modules :
---------
yum install httpd-devel
yum install libxml2-devel

Configuration:
--------------
cp proxy_html.conf /etc/httpd/conf/
vim /etc/httpd/conf/httpd.conf

LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
Include conf/proxy_html.conf

(
Also Check :
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
)

Vhost :
-------
Example :

<VirtualHost 208.109.169.70:80>
ServerAdmin "webmaster@upframr.com"
ServerName upframr.com
ServerAlias www.upframr.com
MIMEMagicFile /dev/null
CustomLog logs/upframr.com_access_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog logs/upframr.com_error_log

DocumentRoot "/home/admin2/public_html"
<Directory "/home/admin2/public_html">
Options +Indexes +FollowSymLinks
Order allow,deny
Allow from all
AllowOverride All
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

Alias /mod_perl "/home/admin2/public_html/mod_perl"
<Directory "/home/admin2/public_html/mod_perl">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</Directory>

<Location /perl-status>
SetHandler perl-script
PerlResponseHandler Apache::Status
Order deny,allow
Deny from all
Allow from upframr.com
</Location>

ScriptAlias /cgi-bin "/home/admin2/public_html/cgi-bin"

Alias /usage /var/www/stats/upframr.com
<Directory /var/www/stats/upframr.com>
Order allow,deny
Allow from all
</Directory>

<Location /usage>
Order allow,deny
Allow from all
</Location>
</VirtualHost>

2 comments:

Unknown said...

...after all these steps,just make symbolic link for libxml or otherwise apxs won't find all libraries needed to compile this apache module

SafetySkills said...
This comment has been removed by the author.