Issue
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.
<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
Does any know what i am missing here?
Solution
Finally, i found that i missed configuration i had to add
NameVirtualHost *:80
to the httpd.conf
Answered By - mspapant Answer Checked By - Pedro (WPSolving Volunteer)