Question

I have two tomcat servers running in my machine and i want to use apache to redirect the traffic to each server depending on the subdomain.

My httpd.conf is:

<VirtualHost *:80>
    ServerName dev.bo.example.com
    ProxyPass / ajp://localhost:11009/bo/
    ProxyPassReverse / ajp://localhost:11009/bo/
    ProxyPassReverseCookiePath /bo/ http://localhost:11001/bo/
</VirtualHost>

<VirtualHost *:80>
    ServerName dev.com.example.com
    ProxyPass / ajp://localhost:10009/com/
    ProxyPassReverse / ajp://localhost:10009/com/
    ProxyPassReverseCookiePath /com/ http://localhost:10001/com/
</VirtualHost>

The problem is that the traffic is always direct to the first tomcat server despite the subdomain i use.

It seems that only the first virtual host match despite if i use:

http://dev.com.com.example.com/ or

http://dev.bo.example.com/

Does any know what i am missing here?

Was it helpful?

Solution

Finally, i found that i missed configuration i had to add

NameVirtualHost *:80

to the httpd.conf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top