Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 89315 invoked from network); 24 Apr 2003 13:31:32 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 24 Apr 2003 13:31:32 -0000 Received: (qmail 13348 invoked by uid 97); 24 Apr 2003 13:33:29 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 13341 invoked from network); 24 Apr 2003 13:33:29 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 24 Apr 2003 13:33:29 -0000 Received: (qmail 83116 invoked by uid 500); 24 Apr 2003 13:29:04 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 83009 invoked from network); 24 Apr 2003 13:29:02 -0000 Received: from latte.harvard.edu (140.247.210.252) by daedalus.apache.org with SMTP; 24 Apr 2003 13:29:02 -0000 Received: from latte.harvard.edu (208-59-250-40.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com [::ffff:208.59.250.40]) (AUTH: LOGIN mdiggory) by latte.harvard.edu with esmtp; Thu, 24 Apr 2003 09:29:06 -0400 Message-ID: <3EA7E6E6.3010107@latte.harvard.edu> Date: Thu, 24 Apr 2003 09:30:14 -0400 From: "Mark R. Diggory" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Servlet Execution with Virtual Hosts and Invoker Problems References: <3EA60F71.4020700@islandcafe.net> <3EA685D2.2050904@islandcafe.net> <3EA68B02.505@latte.harvard.edu> <3EA699D6.10906@islandcafe.net> <3EA6AB50.8070006@latte.harvard.edu> <3EA6D1AF.1050001@islandcafe.net> In-Reply-To: <3EA6D1AF.1050001@islandcafe.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I'm the most experience person at this, I'm sure others on this list might see things that aren't obvious to me. Question: Why are you so concerned about manipulating the invoker itself? In /var/tomcat4/conf/web.xml, tomcat sets up an invoker servlet for all webapplications, why do you need manipulate this? In fact, I believe all calls pass transparently to this default invoker in tomcat. Virtual hosting in apache is pretty clear. We use Virtual hosting to setup https for our site. We currently just let Tomcat handle all our requests to /VDC/* But we could replace this easily with "JKMount /VDC/*.jsp ajp13" and "JKMount /VDC/servlets/* ajp13" too. We do this because, in reality, servlets can be mapped to any URI under /VDC/*. in httpd.conf we have: LoadModule jk_module modules/mod_jk.so Include /etc/httpd/conf/mod_jk.conf ServerName your.virtual.host.here JKMount /VDC/* ajp13 Alias /VDC/ "/var/tomcat4/webapps/VDC/" AllowOverride None deny from all NameVirtualHost xxx.xxx.xxx.xxx:443 ServerName your.virtual.host.here JKMount /VDC/* ajp13 Alias /VDC/ "/var/tomcat4/webapps/VDC/" AllowOverride None deny from all --- in my current server.xml, all I have is (Minus comments and logging). --- Our workers.properties just looks like this: workers.tomcat_home=/var/tomcat4 ps=/ worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=ajp13 --- The one other thing I never seen doc is that we add the apache user to the tomcat4 group in Linux and set the permissions on the /var/tomcat4/webapps directory to a+rx. The only differences between this and what your trying, is that your docBase is outside the /var/tomcat4/webapps directory and your mapping your context to be the ROOT in that virtual host. -Mark Musomi Motilewa wrote: > Alright... I'm still getting the 404 errors. Are there any sites that do > a step-by-step setup of a tomcat-apache combination using an invoker and > virtual hosts? > > Mark R. Diggory wrote: > >> >> >> Musomi Motilewa wrote: >> >>> See comments below for your questions. Hope this clarifies things. >>> Sorry about the confusion. >>> >>> -Musomi >>> >>> Mark R. Diggory wrote: >>> >>>> Hey, I'm just "Joe User" trying to get by same as you. ;-) >>>> >>>> Musomi Motilewa wrote: >>>> >>>>> Hi- >>>>> >>>>> Let me clarify my initial email below. My main problem is that the >>>>> servlets are not being executed when I load them using >>>>> http://ymusic.homedomain.com/servlet/servletName. I don't mind >>>>> having the /servlet directory listed when it is accessed using >>>>> http://ymusic.homedomain.com/servlet/ or the code of the servlet >>>>> displayed when its accessed using >>>>> http://ymusic.homedomain.com/servlet/servletName.class. >>>>> >>>>> At this point any URL that contains /servlet/* is processed by >>>>> tomcat, which is what I want it to do. >>>> >>>> >>>> >>>> >>>> This is unclear, it sounds like your saying you *can* execute the >>>> servlet using /servlet/HelloWorld? >>> >>> >>> >>> >>> >>> None of the servlets are being executed. >>> Tomcat catches all URLs that contain >>> http://ymusic.homedomain.com/servlet/ >>> http://ymusic.homedomain.com/servlet/ - lists the contents of the >>> servlet directory, which is the WEB-INF/classes directory >>> http://ymusic.homedomain.com/servlet/servletName*.class* - which is a >>> link to the class file, returns the code for the class >>> http://ymusic.homedomain.com/servlet/servletName - which is a link to >>> the servlet returns a 404 error >> >> >> >> Here's a thought, consider looking at the default server.xml provided >> by tomcat, you will see a layout that looks like this: >> >> >> >> *> unpackWARs="true" autoDeploy="true">* >> >> ** >> >> > reloadable="true" crossContext="true"> >> ... >> >> >> >> >> Notice that while the path for the ROOT Context is "", that the >> docBase is in the directory ROOT (ie /var/tomcat4/webapps/ROOT). It >> may be the case that the shouldn't be the >> directory of your webapplication itself. Maybe your config should have >> its host in "/home/ymusic" and the contexts docbase in "public_html", >> while keeping the the contexts path "", like this: >> >> >> >> > port="8013" minProcessors="5" maxProcessors="75" >> acceptCount="10" debug="0"/> >> >> > className="org.apache.catalina.logger.FileLogger" >> prefix="apache_log." suffix=".txt" >> timestamp="true"/> >> > className="org.apache.catalina.realm.MemoryRealm" /> >> > appBase="/home/ymusic" unpackWARs="true"> >> > reloadable="true" >> crossContext="true" /> >> >> >> >> >>> >>>> >>>>> However I noticed the directory listing of the /servlet directory >>>>> via Tomcat is coming up as "Directory listing for /" instead of >>>>> "Directory listing for /servlet". I think this is one idication of >>>>> why I'm getting 404 errors when I try to load the servlets. >>>> >>>> >>>> >>>> >>>> >>>> Again now it sounds like your saying the opposite, it sounds like >>>> your saying you *can't* execute the servlet using >>>> /servlet/HelloWorld and get a 404? >>> >>> >>> >>> >>> >>> The servlets aren't being executed, but the servlet directory is >>> being listed. Youc an see all the *.class* files stored in the >>> WEB-INF/classes directory. >>> Tomcat renders this list. The thing is the listing is labeled as the >>> directory listing for "/" not "/servlet". As if Tomcat sees the >>> /servlet directory as the root directory. >>> On the other hand the 404 errors when I try to access the servlets >>> have "/servlet/servletName", which seems to indicate its looking for >>> the servlets in the /servlet path. >>> >>>> >>>>> I've tried removing the following context from the server.xml file: >>>>> >>>> you really shouldn't be mounting the /servlet directory as a >>>> context, its not the way the configuration works: >>>> >>>> is for a Webapplication mount point with the following >>>> directory/war structure. >>>> >>>> path/WEB-INF/web.xml >>>> path/WEB-INF/classes >>>> path/WEB-INF/lib >>>> >>>> the context makes the webapplication available in tomcat. Context is >>>> not a directive to expose directories in Tomcat. I doubt its very >>>> logical to mount a directory in an webapplication as another >>>> webapplication. >>> >>> >>> >>> >>> >>> That is exactly what I want. I want to be able to call class files >>> stored in the WEB-INF/classes folder from jsp pages and URLS in the >>> site. This is the directory structure I have. >>> >>> /home/ymusic/public_html >>> /home/ymusic/public_html/WEB-INF/classes >>> /home/ymusic/public_html/WEB-INF/lib >>> /home/ymusic/public_html/WEB-INF/web.xml >>> >> >> Get your public_html webapplication mounted properly and it will be >> taking care of this accessability for you. Thats the job of the >> webapplication. >> >>> Tomcat is delivering the 404 error pages. >>> >> >> In which case I think its your server.xml thats breaking things. >> >> -Mark >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org