Making a webapp the document root, help?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Tomsic
Posted On:   Tuesday, September 24, 2002 05:01 PM

Is it possible, from Apache 1.3 and Tomcat 4.1.10 (tied together w/ mod_jk) to make a webapp the top-level (DocumentRoot) ?? For instance: /usr/local/tomcat/webapps/MYAPP I want MYAPP to be my document root and start serving JSPs immediately, only using Apache if a HTML file is requested. I don't want to have to type into the browser: http://this.that.com/MYAPP I would like: http://this.that.com and have it simply use the MYAPP from this point on This doesn't work, b/c if I try to access a file: /usr/local/tomcat/webapps/MYAPP/jsp/myfile.jsp using the fo   More>>

Is it possible, from Apache 1.3 and Tomcat 4.1.10

(tied together w/ mod_jk)

to make a webapp the top-level (DocumentRoot) ??


For instance:


/usr/local/tomcat/webapps/MYAPP


I want MYAPP to be my document root and start serving JSPs immediately, only using Apache if a HTML file is requested.


I don't want to have to type into the browser:


http://this.that.com/MYAPP


I would like:
http://this.that.com


and have it simply use the MYAPP from this point on


This doesn't work, b/c if I try to access a file:


/usr/local/tomcat/webapps/MYAPP/jsp/myfile.jsp


using the following URL:


http://this.that.com/jsp/myfile.jsp


I get a 404 error, thrown from Tomcat, b/c the server is apparently looking for that file somewhere else.


Thoughts/help?


Thanks,


Paul

   <<Less

Re: Making a webapp the document root, help?

Posted By:   Paul_Tomsic  
Posted On:   Tuesday, October 15, 2002 11:56 AM

To do this, make that web app the main Context in the server.xml file under $TOMCAT_ROOT/conf/server.xml.

Something like this would do it:




then, if you're using the AJP13 connector, you'd have to also make this a virtual host in the httpd.conf file under apache.


Something like:




ServerAdmin whoever@domain.com
ServerName machine.domain.com
DocumentRoot "/usr/local/tomcat/webapps/MYAPP"
Alias /jsp "/usr/local/tomcat/webapps/MYAPP/jsp"

Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp

JkMount /jsp/*.jsp ajp13

etc....


Hope this helps someone else w/ this problem,

Paul
About | Sitemap | Contact