Apache/Tomcat - Hostheaders


My case:
I have several webapps running on my tomcat server like this:

This is what I want:
Application1.mydomain.com to point to demo.myserver.com/application1
Application2.mydomain.com to point to demo.myserver.com/application2
Application3.mydomain.com to point to demo.myserver.com/application3

This is what I have done:
1. I have set my DNS server to point Application1.mydomain.com and so on to my servers IP address.
2. I have set up apache webserver, apache tomcat6 and the JK2 plugin to make them communicate.
3. I have configured a virtual domain for all my domains in httpd-vhosts.conf and enabled it in httpd.conf.


Include conf/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerName Application1.mydomain.com
JkMount /* workername

4. I have verified that everything works fine with just apache.

My problem is when I try to use the JKMount to redirect the requests to my application. How can I do this? Or is it a better way of doing this?

Start New Discussion
View similar articles that have also been tagged: