<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/mod_proxy'
         s:cUser='david'
         s:oUser=''
         s:mUser='ivan'>
        <s:name>knowledgebase/linux/webserver/apache/mod_proxy</s:name>
        <s:content>1 Passing a Request To Another Server (or server process on same server)&#xD;&#xA;&#xD;&#xA;Sometimes it&apos;s ideal to redirect a request for certain content to either another physical server or another process on the same physical server (e.g. a Mongrel process servicing Rails request).  You can utilize mod_proxy to handle this via the following code:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;#pass all requests coming into the root of the app to another process&#xD;&#xA;ProxyPass        / http:\//www.yourdomain.com:8000/&#xD;&#xA;ProxyPassReverse / http:\//www.yourdomain.com:8000/&#xD;&#xA;&#xD;&#xA;#pass requests off to another physical server&#xD;&#xA;ProxyPass        / http:\//www.otherserver.com/&#xD;&#xA;ProxyPassReverse / http:\//www.otherserver.com/&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;This process should be transparent to the client making the request.  The ProxyPassReverse directive ensures Apache will modify response headers so as to appear to be originating from the frontend server.&#xD;&#xA;&#xD;&#xA;1 Using mod_proxy with Tomcat/Liferay&#xD;&#xA;&#xD;&#xA;To serve your tomcat/liferay application through Apache, add the following inside your VirtualHost definition:&#xD;&#xA;{code}&#xD;&#xA;&lt;VirtualHost *:80&gt;&#xD;&#xA;    ServerName example.com&#xD;&#xA;    ProxyRequests Off&#xD;&#xA;    ProxyPass / ajp://127.0.0.1:8009/&#xD;&#xA;    ProxyPassReverse / ajp://127.0.0.1:8009/&#xD;&#xA;&lt;/VirtualHost&gt; &#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The code above would direct all your site&apos;s traffic to the tomcat/liferay installation, ie. http://example.com:8080/ and http://example.com/ would show the same content.&#xD;&#xA;&#xD;&#xA;If you need to direct only one part of the site to a tomcat/liferay app, the code would look as follows:&#xD;&#xA;{code}&#xD;&#xA;ProxyPass /tomcat ajp://127.0.0.1:8009/&#xD;&#xA;ProxyPassReverse /tomcat ajp://127.0.0.1:8009/&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Or if you have more than one application running at the same time:&#xD;&#xA;{code}&#xD;&#xA;ProxyPass /tomcat ajp://127.0.0.1:8009/jsp-examples/&#xD;&#xA;ProxyPassReverse /tomcat ajp://127.0.0.1:8009/jsp-examples/&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Remember to add the trailing slashes to those ajp URLs!&#xD;&#xA;&#xD;&#xA;1 Passing specific files to Tomcat&#xD;&#xA;&#xD;&#xA;Allowing apache to host static content and Tomcat to host the dynamic content without touching the directory structures is useful.sometimes. To do this mod_proxy_ajp is used in conjunction with mod_rewrite like so:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;RewriteEngine on&#xD;&#xA;RewriteCond %{REQUEST_URI} /(.*).jsp|.muse|.do(.*)&#xD;&#xA;RewriteRule ^/(.*) ajp://localhost:8009/$1 [P]&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;File name extensions are seperated with a `|` &#xD;&#xA; &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;</s:content>
        <s:mTime>2008-01-07 22:10:32.0</s:mTime>
        <s:cTime>2007-05-04 14:23:40.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/memory troubleshooting'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/java/-Xmx settings'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix with amavis and mysql'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/monthly CC billing not working'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on RHEL4'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/plesk notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/mod_rewrite'/>
                <rdf:li rdf:resource='#ivan'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/java/liferay install on tomcat 5.5'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/hosts file'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/webserver/apache/installing and using mod_fastcgi'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
