I'm having trouble with making a subdomain to my Windows computer while using AJP to proxy to Tomcat. This is what I have in my httpd.conf file:
<VirtualHost *:80>
ServerName subdomain.localhost
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / ajp://localhost:8009/folder/
ProxyPassReverse / ajp://localhost:8009/folder/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
The subdomain has been added to `c:\windows\system32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 subdomain.localhost
When I go to http://localhost
i goes straight to the proxy. When I go to http://subdomain.localhost
i goes to the proxy as well. How do I make is so the subdomain only goes to the proxy and the regular goes to Apache?
This should probably be moved to superuser.com but one thing to try:
<VirtualHost *:80
> informs it to accept all incoming connections on port 80 to use these settings. I would try changing it to say:and see if that only applies these settings when the subdomain is used.
The ServerName tag that you put with the subdomain doesn't tell it who to listen for. The official documentation states:
You can read more on these configurations here.
You need to declare a second VirtualHost with localhost as the ServerName.