使用AJP代理Tomcat时,无法在Windows计算机上创建子域。这就是我的httpd.conf文件中的内容:
<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>
子域已添加到`c:\ windows \ system32 \ drivers \ etc \ hosts
127.0.0.1本地主机 127.0.0.1 subdomain.localhost
当我去的时候,http://localhost我直接去代理。当我去时,我也会去http://subdomain.localhost代理。我如何才能使子域仅转到代理,而常规域名转到Apache?
http://localhost
http://subdomain.localhost
您需要声明第二个VirtualHost,其中localhost作为ServerName。