With Jakatra/5.5.9 I'm having trouble settings up a <Host> that has its 
appBase="" setup outside of the usual $CATALINA_BASE directory tree.

Tomcat is running as userid "jakarta", file permissions are all fine and my web 
application auto-deploys sucessfully from a WAR within the alternate appBase="" directory 
tree.

But when I do HTTP request to my simple /index.jsp file I get the HTTP error "400 No 
Host matches server name test.foobar.com"

If I try and access my page as /MyROOT/index.jsp that works, but the META-INF/context.xml 
has a configuration that tries to setup this application as the default context 
(path="").

I believe I'm doing all the correct things to make this work.

I would also like to alias two (or more) contexts to the same web-app.  The default 
(path="") being just one of them.  I would like this to be possible from within the WAR 
file, but it appears only one <Context> is allowed inside META-INF/context.xml as its the outer 
document tag for that file.  What do others thing, if it would be useful for TC to implement a TC 
specific extension that simply searched for META-INF/tomcat-context.xml that would facilitate the 
multiple <Context> creation from WAR deployment.

Your help appreciated.



# telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET /index.jsp HTTP/1.0
User-Agent: Wget/1.9.1
Host: test.foobar.com
Accept: */*
Connection: Keep-Alive
Pragma: no-cache

HTTP/1.1 400 No Host matches server name test.foobar.com
Server: Apache-Coyote/1.1
Date: Tue, 16 Aug 2005 03:45:20 GMT
Connection: close

Connection closed by foreign host.



<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="test.foobar.com" appBase="/opt/test.foobar.com/tomcat/webapps"
       workDir="/opt/test.foobar.com/tomcat/work"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>


# cat /opt/jakarta-tomcat-5.5.9/conf/Catalina/test.foobar.com/MyROOT.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="MyROOT" reloadable="true">
       <Logger className="org.apache.catalina.logger.FileLogger"
            prefix="localhost_MyROOT_log." suffix=".txt"
            timestamp="true"/>
</Context>


# cd /opt/test.foobar.com && find tomcat
tomcat
tomcat/webapps
tomcat/webapps/MyROOT
tomcat/webapps/MyROOT/index.jsp
tomcat/webapps/MyROOT/WEB-INF
tomcat/webapps/MyROOT/WEB-INF/web.xml
tomcat/webapps/MyROOT/WEB-INF/classes
tomcat/webapps/MyROOT/WEB-INF/classes/test
tomcat/webapps/MyROOT/WEB-INF/classes/test/Klass.java
tomcat/webapps/MyROOT/WEB-INF/classes/test/Klass.class
tomcat/webapps/MyROOT/META-INF
tomcat/webapps/MyROOT/META-INF/context.xml
tomcat/webapps/MyROOT/META-INF/MANIFEST.MF
tomcat/webapps/MyROOT.war
tomcat/work
tomcat/work/MyROOT
tomcat/work/MyROOT/tldCache.ser

# ls -lad tomcat tomcat/webapps tomcat/work tomcat/webapps/MyROOT.war drwxrwxr-x 4 jakarta jakarta 4096 Aug 3 12:31 tomcat
drwxrwxr-x  3 ftpuser    jakarta 4096 Aug 16 04:39 tomcat/webapps
-rw-rw-r--  1 ftpuser    jakarta 2251 Aug 16 04:39 tomcat/webapps/MyROOT.war
drwxrwxr-x  3 jakarta    jakarta 4096 Aug 16 04:39 tomcat/work

# ps uax | grep jsvc
root     22427  0.0  0.0  1600  536 ?        Ss   Aug08   0:00 jsvc.exec 
-Djava.endorsed.dirs=./common/endorsed -classpath 
:/opt/jakarta-tomcat-5.5.9/bin/bootstrap.jar:/opt/jakarta-tomcat-5.5.9/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat-5.5.9 
-Dcatalina.home=/opt/jakarta-tomcat-5.5.9 
-Djava.io.tmpdir=/opt/jakarta-tomcat-5.5.9/temp -outfile ./logs/catalina.out 
-errfile ./logs/catalina.err -pidfile ./logs/jsvc.pid -user jakarta -Xmx2048M 
-Xms512M -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
org.apache.catalina.startup.Bootstrap start
jakarta  22428  0.0  1.1 2353532 86788 ?     Sl   Aug08   3:05 jsvc.exec 
-Djava.endorsed.dirs=./common/endorsed -classpath 
:/opt/jakarta-tomcat-5.5.9/bin/bootstrap.jar:/opt/jakarta-tomcat-5.5.9/bin/commons-logging-api.jar
 -Dcatalina.base=/opt/jakarta-tomcat-5.5.9 
-Dcatalina.home=/opt/jakarta-tomcat-5.5.9 
-Djava.io.tmpdir=/opt/jakarta-tomcat-5.5.9/temp -outfile ./logs/catalina.out 
-errfile ./logs/catalina.err -pidfile ./logs/jsvc.pid -user jakarta -Xmx2048M 
-Xms512M -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
org.apache.catalina.startup.Bootstrap start




--
Darryl L. Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to