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

Using that answer: How to redirect traffic on port 80 to Tomcat port 8080 whilst still allowing the server to send/receive on port 80

I've configured my apache2 server to redirect some requests to glassfish on 8080:

<VirtualHost *:80>
ProxyPass /tomcat/ http://localhost:8080/
ProxyPassReverse /tomcat/ http://localhost:8080/
ProxyPass /tomcat-admin/ http://localhost:4848/
ProxyPassReverse /tomcat-admin/ http://localhost:4848/

On , I can clearly see:

 GlassFish Server 3.1.2
Your server is now running

but returns a blank screen , but I can see the HTML source of the admin page, so I suppose that some resources cannot be loaded. How should I fix this ?

Another question: if my java web application use httpS, should I just add:

ProxyPass /tomcat-secure/ http://localhost:8443/
ProxyPassReverse /tomcat-secure/ http://localhost:8443/


share|improve this question
What do your apache logs say? – ProfessionalAmateur Jan 9 '13 at 18:17

Unfortunately I don't know anything about that apache-proxy stuff. However, I had a similar problem and my workaround may help you to solve your issue.

I fully integrated tomcat into apache using mod-jk. Assuming you're using a Debian-based distro just install libapache2-mod-jk and configure the module in /etc/libapache2-mod-jk/ You may need something like this:


These parameters define the connection between apache and tomcat. I told tomcat to only listen to But it should be fine to configure the module to speak to another IP and/or a different port if you need a standalone tomcat installation available without apache.

Next step: Open /etc/apache2/mods-available/jk.conf and make sure that apache reads these properties:

JkWorkersFile /etc/libapache2-mod-jk/

If that is done, the communication between apache and tomcat should work. Now you can create some hosts forwarding their requests to tomcat:

<VirtualHost *:80>
    RewriteEngine on
    RewriteRule ^/(.*)$ /YourContext/$1 [L,PT]
    JkMount /* ajp13_worker

This virtual host will forward each request to the context YourContext at tomcat. ajp13_worker is the worker-definition as previously configured in /etc/libapache2-mod-jk/ (of course you can configure multiple workers for different IPs/ports) and the RewriteRule rewrites the query to prefix it with YourContext. So you also need the rewrite module, if it's not already enabled. Enable the modules and this host:

a2enmod jk
a2enmod rewrite
a2ensite 007-what-ever-host
service apache2 restart
service tomcat7 restart

and go for You'll hopefully end up with the same result as if you call

Hope that helps ;-)

share|improve this answer

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.