I have a apache setup that redirect to my app running on tomcat. Loading http://domain.com works fine. However http://www.domain.com gives me a 404 error.
What am I missing?
NameVirtualHost www.domain.com:80
<VirtualHost www.domain.com:80>
ServerName www.domain.com
ProxyPass /svn !
ProxyPass / ajp://127.0.0.1:8009/appname/
ProxyPassReverse / ajp://127.0.0.1:8009/appname/
ProxyPassReverseCookiePath /appname/
</VirtualHost>
Following the first comment I have altered by code to be:
<VirtualHost www.domain.com:80>
ServerName www.domain.com
ServerAlias www.domain.com domain.com
ProxyPass /svn !
ProxyPass / ajp://127.0.0.1:8009/appname/
ProxyPassReverse / ajp://127.0.0.1:8009/appname/
ProxyPassReverseCookiePath /appname/
</VirtualHost>
In the apache logs I see a 404 error "GET / HTTP/1.1" 200 16060" In the browser I see an apache tomcat 404 error (tomcat 6.0.28) I see nothing in the tomcat logs
Use ServerAlias.
<VirtualHost www.domain.com:80>
ServerName www.domain.com
ServerAlias www.domain.com domain.com
ProxyPass /svn !
ProxyPass / ajp://127.0.0.1:8009/appname/
ProxyPassReverse / ajp://127.0.0.1:8009/appname/
ProxyPassReverseCookiePath /appname/
</VirtualHost>
Edit: When facing that kind of problems, you can directly hit tomcat on its HTTP port (see server.xml) and check if the problem occurs.