Posted on

Apache Proxy for Tomcat

So I am working on this ContactCampaigns.com site in my spare time to keep my skills sharp.
Looks like I need to setup Apache as a proxy, even for development purposes.

Wish me luck, I’m playing around with the directions I found here:
http://wiki.apache.org/httpd/TomcatReverseProxy

________

Okay, I totally bypassed those directions and did this instead:

 

<VirtualHost *:80>

ServerName contactcompaigns.local

DocumentRoot “C:\Users\Robert\springsource3\emailcampaigner\web-app”
<Directory   “C:\Users\Robert\springsource3\emailcampaigner\web-app”>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

ProxyRequests Off
ProxyVia On

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/$ http://localhost:8080/emailcampaigner [P,L]
RewriteCond %{REQUEST_URI} !^/(css|js|swf|img|media|video|html|d2c-deploy)/.*|crossdomain\.xml$
RewriteRule ^(.*)$ http://localhost:8080/$1 [P,L]

</VirtualHost>

______________

I have no idea what I am doing here, and starting to think about using http://tuckey.org/urlrewrite/.
The problem here is running Tomcat on port 80.

I much rather master the art of configuring Apache correctly.