6. Apache 2 Proxy

Apache 2 has a proxy module which allows Pazpar2 to become a backend to an Apache 2 based web service. The Apache 2 proxy must operate in the Reverse Proxy mode.

On a Debian based Apache 2 system, the relevant modules can be enabled with:

     sudo a2enmod proxy_http proxy_balancer

Traditionally Pazpar2 interprets URL paths with suffix /search.pz2. The ProxyPass directive of Apache must be used to map a URL path to the Pazpar2 server (listening port).


The ProxyPass directive takes a prefix rather than a suffix as URL path. It is important that the Java Script code uses the prefix given for it.

Example 2.1. Apache 2 proxy configuration

If Pazpar2 is running on port 8004 and the portal is using search.pz2 inside portal in directory /myportal/ we could use the following Apache 2 configuration:

      <IfModule mod_proxy.c>
       ProxyRequests Off

       <Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Allow from all

       ProxyPass /myportal/search.pz2 http://localhost:8004/search.pz2
       ProxyVia Off