Apache subdomain for proxy server in Tomcat
I am having problems creating a subdomain on my windows machine while using AJP for Tomcat proxy. 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>
Subdomain 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 go straight to the proxy. When I go to http://subdomain.localhost
, I also go to proxy. How can I make it so that the subdomain only goes to the proxy server, and the normal one goes to Apache?
source to share
This should probably be ported to superuser.com but should try:
<VirtualHost *:80
> informs him to accept all incoming connections on port 80 to use these settings. I would try changing it to say:
<VirtualHost subdomain.localhost:80>
and see if these options only apply when using a subdomain.
The ServerName tag that you put on a subdomain does not tell it who to listen to. The official documentation states:
The ServerName directive sets the hostname and port that the server uses to identify itself. This is used when generating redirect urls. For example, if the hostname of the host web server is simple.example.com, but the host also has a DNS alias www.example.com and you want the webserver to be defined like this, the following directives should be used:
You can read more about these configurations here .
source to share