You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Gormley, Josh" <JG...@parts-unltd.com> on 2006/09/26 18:12:10 UTC

Tomcat vs Apache virtual host declarations

Hello,

 

I'm a little confused about how Apache and Tomcat handle virtual hosts.
I have a server which hosts 3 subdomains, each of which is a Tomcat
webapp.  With my current setup, if I go to 

http://rtv.mydomain.com <http://rtv.mydomain.com/> 

I can see my app running.  But if I undeploy the app (using either an
ant script or the tomcat manager - I've tried both) and then deploy an
updated war file, I cannot see any of the changes at that url unless I
restart Tomcat.  At first I thought this was a garbage collection issue,
but now I'm not so sure because if I go to this url:

http://10.2.1.100:8080/rtv

I can see the changes to the app right away without having to restart
tomcat.

 

So, my webapp is being cached somewhere and I'm not sure where.  I have
listed my Apache VirtualHost and Tomcat server.xml Host settings below,
is there something in there that I'm missing?

 

Thanks in advance,

Josh Gormley

 

 

VirtualHost declaration in httpd:

 

<VirtualHost *:80>

            ServerName rtv.myhost.com

            ServerAlias www.rtv. myhost.com

            DocumentRoot /usr/local/tomcat/webapps/rtv

            DirectoryIndex index.jsp index.html

            ErrorLog logs/rtv. myhost.com-errorlog

            CustomLog logs/rtv. myhost.com-accesslog common

 

            <Directory "/usr/local/tomcat/webapps/rtv">

                        Options +FollowSymLinks

                        Order allow,deny

                        Allow from all

            </Directory>

 

            #DENY ACCESS TO WEB-INF and META-INF

            <Location "/WEB-INF/*">

                        AllowOverride None

                        deny from all

            </Location>

 

            <Location "/META-INF/*">

                        AllowOverride None

                        deny from all

            </Location>

 

            #ROUTE ALL JSP AND SERVLETS TO THE mod_jk WORKER

            #These extensions are already specified in the
/etc/httpd/conf.d/jk.conf file

            JkMount /*.do router

            JkMount /*.jsp router

</VirtualHost>

 

 

Host declaration in server.xml:

 

-
<file:///C:\Documents%20and%20Settings\jgormley\Application%20Data\SSH\t
emp\server.xml##>  <<Host name="rtv.myhost.com"
appBase="/usr/local/tomcat/webapps/rtv" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

  <  <Context path="" docBase="" debug="" /> 

  <  <Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="rtv.myhost.com_log" /> 

 </Host>