Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i'm trying to set up a dev environment with apache2.2 + tomcat + mysql.

Of course i already have apache2.2 + mysql working fine with php but, when i look at google about how to setup tomcat, i find a lot of confusion.

Someone uses proxy, someone rewriterules and so on...

Could you please give me some info/links about how to accomplish this task?

Bests, Andrea

share|improve this question

I serve multiple apps off of one Tomcat instance and proxy them through Apache on the same box as virtual hosts.

Here is my basic configuration for Apache. The Tomcat instance is left nearly in defaults (only minimal modifications for security). You'll need to enable mod-proxy_ajp in Apache and configuration virtual hosts. This is a copy and paste of my config so there is SSL stuff in there too.

<VirtualHost *:443>

    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/yourdomain.pem

    RewriteEngine On
    RewriteRule ^/yourappname/(.*)$$1 [L]

    ProxyPreserveHost   On

    ProxyPass / ajp://localhost:8009/yourappname/
    ProxyPassReverse / ajp://localhost:8009/yourappname/

    <Proxy *>
        Order allow,deny
        Allow from all

    ErrorLog /var/log/apache2/

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/ combined
    ServerSignature Off
share|improve this answer
See the following link for information about getting the cookie to proxy correctly (not in the URL). I have not modified my config for this yet, but plan to do it in development soon.… – J.Zimmerman Apr 30 '10 at 0:11
Thanks dude, i really appreciate :) – Andrea Baccega May 1 '10 at 11:17
Thanks a lot, wish I could upvote this more than once! – Michael Wiles Dec 19 '11 at 11:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.