I'm in the same boat myself. It looks like Apache isn't fielding your 
servelet requests.  After you got the Tomcat examples running, could you 
get Apache to forward the requests to Tomcat as appropriate? That is, 
could you get the examples running using a non-virtual host with Apache?

I've gotten that far but haven't been able to get the virtual hosts to 
work either. In my case, I'm getting 500 errors which seems to indicate 
a problem with java locating the things it needs. I suspect that I need 
to reconfigure the applications to make them work but I'm groping around 
in the dark here too.


Frank wrote:

> I've spent hours and hours trying to set up a quit simple virtual 
> hosting server with apache & tomcat.
> I get an error from tomcat upon requesting an example servlet from a 
> virtual server.
> Just finished rebuilding the whole server, reading again all available 
> documents, reading again through the
> newsgroup archives trying to find what the error could possible mean 
> and how to get things working.
> I already far over my deadline in finishing a multiple hosting 
> platform for servlets and I'm getting a little
> bit desperate here.
> Could _please_ someone who recognize either the error or find an 
> overlooked error in my config respond??
> It might be simple..but I just can' t find it, don't know where to 
> look, probably the workers/connectors or
> something..
> As sysadmin the whole servlet stuff is new...and being sysadmin alone 
> isn't enough here to set up a server
> like this it seems.
>
> Any help appreciated,
>
> Frank
>
>
> Tomcat and namebase virtual hosting
>
> apache 1.3.17/mod_ssl
> tomcat 3.2.2
> mod_jk.so (compiled from source)
> jdk1.2.2 (sun)
>
>
>
> Problem:
> On a requesting a small example application from a virtual webserver 
> with an
> url like http://test1.zx.nl:9000/servlets/world.HelloWorld tomcat 
> gives an
> error and times out:
>
>
> --begin error--
>
> BAD packet 18245
> In: : [B@99ad5912 4/21536/8192
> 47 45 54 20 00 00 00 00 00 00 00 00 00 00 00 00  | GET.............
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
> ........
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | ................
> java.lang.ArrayIndexOutOfBoundsException: 8192
>         at 
> org.apache.tomcat.service.connector.MsgBuffer.hexLine(MsgBuffer.java)
>         at 
> org.apache.tomcat.service.connector.MsgBuffer.dump(MsgBuffer.java:24)
>         at 
> org.apache.tomcat.service.connector.MsgBuffer.checkIn(MsgBuffer.java)
>         at 
> org.apache.tomcat.service.connector.TcpConnector.receive(TcpConnecto)
>         at 
> org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processCo)
>         at 
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java)
>         at 
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.jav)
>         at java.lang.Thread.run(Thread.java:479)
>
> --end error--
>
> When I leave the portnumber out, tomcat nicely answers with a 404.
>
> Tomcat Example applications are working (http://test.bos.nl:8080) I 
> created
> a small (http://test.bos.nl/example.html) example application, which I
> dropped in the tomcat example directory and that works fine as
> (http://test.bos.nl:8080/examples/servlet/world.HelloWorld) well.
>
> Configuration:
>
>
> httpd.conf:
>
> LoadModule    jk_module  libexec/mod_jk.so
> AddModule     mod_jk.c
> JkWorkersFile /opt/zx/tomcat/conf/workers.properties
> JkLogFile     /opt/zx/apache/logs/mod_jk.log
> JkLogLevel    warn
>
> <VirtualHost 195.81.39.24>
>  ServerName test1.zx.nl
>  Documentroot /opt/www/test1.zx.nl/htdocs
>  Errorlog /opt/www/test1.zx.nl/logs/error.log
>  Customlog /opt/www/test1.zx.nl/logs/access.log Combined
>  JkMount /*.jsp test01-ajp13
>  JkMount /servlets/* test01-ajp13
>  <Location "/WEB-INF/">
>   AllowOverride None
>   order deny,allow
>   deny from all
>  </Location>
>  <Location "/META-INF/">
>    AllowOverride None
>    deny from all
>  </Location>
> </VirtualHost>
>
> <VirtualHost 195.81.39.24>
>  ServerName test2.zx.nl
>  Documentroot /opt/www/test2.zx.nl/htdocs
>  Errorlog /opt/www/test2.zx.nl/logs/error.log
>  Customlog /opt/www/test2.zx.nl/logs/access.log Combined
>  JkMount /*.jsp test02-ajp13
>  JkMount /servlets/* test02-ajp13
>  <Location "/WEB-INF/">
>   AllowOverride None
>   order deny,allow
>   deny from all
>  </Location>
>  <Location "/META-INF/">
>    AllowOverride None
>    deny from all
>  </Location>
> </VirtualHost>
>
>
> workers.properties:
>
> worker.list=ajp12, ajp13, test01-ajp13, test02-ajp13
>
> worker.test01-ajp13.port=9000
> worker.test01-ajp13.host=test1.zx.nl
> worker.test01-ajp13.type=ajp13
>
> worker.test02-ajp13.port=9500
> worker.test02-ajp13.host=test2.zx.nl
> worker.test02-ajp13.type=ajp13
>
>
> server.xml:
>
> <Connector className="org.apache.tomcat.service.PoolTcpConnector">
>  <Parameter name="handler" 
> value="org.apache.tomcat.service.connector.Ajp13Conne
> ctionHandler"/>
>  <Parameter name="port" value="9000"/>
> </Connector>
> <Connector className="org.apache.tomcat.service.PoolTcpConnector">
>  <Parameter name="handler" 
> value="org.apache.tomcat.service.connector.Ajp13Conne
> ctionHandler"/>
>  <Parameter name="port" value="9500"/>
> </Connector>
>
> <Host name="test1.zx.nl">
>  <Context path="/servlets" docBase="/opt/www/test1.zx.nl/webapz" 
> debug="0" reloadable="true" />
> </Host>
> <Host name="test2.zx.nl">
>  <Context path="/servlets" 
> docBase="/opt/www/test2.zx.nl/htdocs/webapz" debug="0" 
> reloadable="true" />
> </Host>
>
> In both virtual webserver I created as servlet base the directory 
> htdocs/webapz.
> I've put the small example with adjusted text (Hello World!) in both 
> webs.
> (under htdocs/webapz/WEB-INF/classes/world/HelloWorld.java) and 
> compiled them.
> I created a small (http://test.bos.nl/web.txt) web.xml, but I can 
> leave it out or let it stay under the
> WEB-INF directories, I keep getting the mentioned error.
>
>
> Well..one should think that http://virtualserver/servlets/word.HelloWorld
> should give a nice message on the screen...not.
>
>
>
>
>
>
>



Reply via email to