Hello:
I am trying to set-up a virtual host on my set-up with
apache and tomcat.
Here is what I did:
I added this to the htpd.conf file:
<VirtualHost [IP Address]>
DocumentRoot /home/myhost/public-html
ServerName myhost.JAMMConsulting.com
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
<Directory "/home/myhost/public-html/WEB-INF">
deny from all
Options None
</Directory>
</VirtualHost>
I added the following to tomcat's server.xml:
<Host name="myhost.JAMMConsulting.com">
<Context path="" docBase="/home/myhost/public-html" debug="0"/>
</Host>
I put the following web.xml in the directory
/home/myhost/public-html/WEB-INF:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
setup
</servlet-name>
<servlet-class>
SetupServlet
</servlet-class>
<init-param>
<param-name>DbName</param-name>
<param-value>mydb</param-value>
</init-param>
<init-param>
<param-name>DbUser</param-name>
<param-value>myuser/param-value>
</init-param>
<init-param>
<param-name>DbPassword</param-name>
<param-value>[password]</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
I restarted both apache and tomcat.
The setup servlet is there to create a database pool, but it
is not getting loaded. I tried putting some logging in the
SetupServlet and it does not get called.
I manually visited
http://myhost.JAMMConsulting.com/servlet/SetupServlet
and it worked fine.
So, apparently the web.xml is not being loaded by the
web application.
Any ideas?
Thanks,
Neil.
--
Neil Aggarwal
JAMM Consulting, Inc. (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development Websites, Ecommerce, Java, databases