Initially I had a webapp called "admin" running fine, deployed inside the $CATALINA_HOME/webapps/ directory of tomcat 6. Now I tried setting up a vitual host to run this webapp.
Step1: I added the following in $CATALINA_HOME/conf/server.xml
<Host name="mysubdomain.domain.com" appBase="keshav">
</Host>
Step2: I created a folder $CATALINA_HOME/keshav
Step3: Created the ROOT context as $CATALINA_HOME/keshav/ROOT
Step4: Moved my "admin" webapp (which was inside $CATALINA_HOME/webapps/) to $CATALINA_HOME/keshav
Now when I access http://mysudomain.domain.com/admin/jsp/login.jsp, it WORKS fine bringing up the login page. But when I try accessing http://mysubdomain.domain.com/admin/Login.do or any other struts action it gives me 404 error-
"HTTP Status 404 - Servlet action is not available"
In the catalina.out file I get the message "INFO: Servlet action is currently unavailable"
Can anyone please help me figure out what is wrong in this config?
UPDATE: I also had changed the connector port from 8080 to 80. Since opening 80 port requires root privileges, I am starting tomcat using sudo (the user that I am using is in the sudoers list).
Whenever I run tomcat with sudo, the 404 error for struts actions are occuring. If I change the connector port from 80 to 8080 and start without using sudo, the virtual host is working fine..
If I su to root and start tomcat, it is working fine as well. Using sudo seems to be causing this problem..
This is typical of ActionServlet. It maps all exception to UnavailableException so you always get "unavaiable" error even if the servlet is dead. There should be other information in log to show you the exact cause.
When you run the server in sudo, the environment changes. Maybe struts config relies on some environment variable or default working directory?
Try "sudo -s catalina.sh
". It may help.