19 February, 2008

Apache front-end for Archiva

To use apache httpd as a proxy/mirror for archiva, I made these modifications to httpd.conf:

<IfModule mod_proxy.c>
ProxyRequests Off

<Proxy /archiva>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /8081/ http://myhost:8081/
ProxyPassReverse / http://myhost:8081/

RewriteEngine On
RewriteRule "^/archiva/(.*)" "http://myhost/8081/archiva/$1" [P]
RewriteRule "^/archiva" "http://myhost/8081/archiva/" [P]

</IfModule mod_proxy.c>

If SELinux is used, you might need to:
   /usr/sbin/togglesebool httpd_can_network_connect
to check the status of the relevant SE flags:
   sestatus -b | grep httpd
A less complicated variant:

<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On

<Proxy /nexus>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /nexus http://localhost:8081/nexus
ProxyPassReverse /nexus http://localhost:8081/nexus

<Location /nexus>
    Order allow,deny
    Allow from all      
</Location>

</IfModule>

No comments: