Monday, March 31, 2008

PROXY for PEAR channel


I recently submitted a bug report on PEAR regarding a long standing issue with the PEAR installer tool: there is no support for HTTP 302 (redirect). This condition effectively limits the hosting possibilities of PEAR channels e.g. a PEAR channel can not be accessible through a DNS cname aliases.

Problem

Suppose I have hosted a PEAR REST channel on Google Project @ http://mediawiki.googlecode.com/svn and now I would like to make this channel friendly through a nicer URL like " mediawiki.pear.jldupont.com ".
(note that the above is just an example: the channel on which I used the method described below in not yet publicly available)

Solution

The solution involves setting up a PROXY. This time around I have managed the feat with Apache using proxy_module 'mod_proxy.so' : in my vhost configuration, I have added:

<VirtualHost mediawiki.pear.jldupont.com:80>

ServerName mediawiki.pear.jldupont.com

DocumentRoot /var/www/vhosts/mediawiki.pear.jldupont.com

#PERFORMANCE tuning
#NOTE: not strictly required for the PROXY functionality
SetOutputFilter DEFLATE

ProxyRequests Off
ProxyPass / http://mediawiki.googlecode.com/svn/
ProxyPassReverse / http://mediawiki.googlecode.com/svn/

</VirtualHost>

No comments:

Post a Comment