Donnerstag, 3. Dezember 2009

Apache2 httpd, Apache Tomcat6 and rewrite problems

While configuring a Apache2 as Proxy for a bunch of Tomcats behind I found many postings that says "Use mod_rewrite and this set of rules" or "you have to use ajp and mod_jk". After some rtfm I found out that setting up a Apache2 httpd with multiple Apache Tomcats behind mapped using mod_proxy is pretty simple and straight forward. here is the HowTo:
1. Add a site to the apache2:
cat /etc/apache2/sites-enabled/artifactory
<Location /artifactory/>
    ProxyPass http://127.0.0.1:8100/artifactory/
    Order deny,allow
    Allow from all
</Location>
2. Enable mod_proxy by creating the following links (ln -s target) in /etc/apache2/mods-enabled/
proxy.conf -> ../mods-available/proxy.conf
proxy_http.load -> ../mods-available/proxy_http.load
proxy.load -> ../mods-available/proxy.load
3. Modify the content of /etc/apache2/mods-enabled/proxy.conf :
<IfModule mod_proxy.c>
ProxyRequests Off

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

</IfModule>
4. reload the apache2 server:
/etc/init.d/apache2 reload
5. modify $TOMCAT_HOME/conf/server.xml
Change from:
<Connector port="8100" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" />
to
<Connector port="8100" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443"
proxyName="YourDomain.YourTLD" proxyPort="80"/>

Keine Kommentare:

  © Blogger template 'Morning Drink' by Ourblogtemplates.com 2008

Back to TOP