Re: Tomcat configuration question
"Robert Dale" <[email protected]>
| Newsgroups | gmane.org.user-groups.trijug.juglist |
|---|---|
| Message-ID | <[email protected]> |
Try this.. http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html On Wed, Jan 14, 2009 at 9:11 PM, Richard O. Hammer <[email protected]> wrote: > I am trying to get a shorter URL to work in an application deployed in > Tomcat 5.5. I am creating a web application in Eclipse 3.3.2 and exporting > a WAR from Eclipse into Tomcat 5.5 (which implements Servlet 2.4). > > Here is the tomcat/conf/server.xml file I am using, shortened to show just > what I think may be important: > > <Server port="8005" shutdown="SHUTDOWN"> > <Service name="Catalina"> > <Connector port="80" > maxThreads="15" minSpareThreads="1" maxSpareThreads="2" > enableLookups="false" redirectPort="443" acceptCount="6" > connectionTimeout="20000" disableUploadTimeout="true" /> > > <Engine name="Catalina" defaultHost="localhost"> > <Host name="localhost" appBase="webapps" /> > > <Host name="myDomain.com" appBase="/myDomain/app" > unpackWARs="true" autoDeploy="true"> > > <Valve className="org.apache.catalina.valves.AccessLogValve" > directory="myLogs" prefix="access." suffix=".log" > pattern="common" resolveHosts="false"/> > <Context path="" docBase="." /> > </Host> > </Engine> > </Service> > </Server> > > > When I copy the file named "Apln.war" into my appBase="/myDomain/app" > directory, Tomcat unpacks and deploys the application just fine into a new > directory named /myDomain/app/Apln . It all works. But I'm fussy about the > URL. > > In order to access the pages in a web browser, I have to include "Apln" in > the URL, like this: > http://myDomain.com/Apln/fun.jsp > How can I get that "Apln/" out of the URL? I want the URL to be: > http://myDomain.com/fun.jsp > > Other information that may be relevant: > - I am not using any other XML file to declare the Context element, since I > guess that should not be necessary, although the Tomcat documents frequently > remind me that I could do that. > - The WEB-INF/web.xml file has only the few automatically created elements. > I have not edited it. And I don't think it matters for this issue. > - Note that the appBase for Host myDomain.com is an absolute path, outside > the default appBase="webapps". I don't think that should matter. > > I have tried setting the Context docBase attribute to an absolute path > outside the /myDomain/app directory, since I find the following instruction, > "When using automatic deployment, the docBase defined by an XML Context file > should be outside of the appBase directory." > in this section of the documentation > <http://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Automatic%20Application%20Deployment>. > But that doesn't work for me. I don't understand how that could work, since > the automatic unpacking of the war file takes place in the same directory > where the war is dropped, in the /myDomain/app directory. > > Thanks for any help that can be given, > Rich Hammer > > > _______________________________________________ > Juglist mailing list > [email protected] > http://trijug.org/mailman/listinfo/juglist_trijug.org > -- Robert Dale