PDA

View Full Version : Adding a New Dir in Webapp to Tomcat



Mary
05-07-2007, 11:44 AM
I've read the previous posts about this and am till having problems. I'm a complete newbie to Tomcat.. never used it before. I need to add a new directory under webapps called rreport. Here's what I've done..

added new directory under webapps called rreport (put an index.html file in to test)

added "JkMount /rreport/* ajp13" to etc/httpd/conf/mod_jk.conf

added "<Context path="/var/tomcat4/webapps/rreport" docBase="rreport" debug="0" reloadable="true"> " to etc/tomcat4/server.xml

the hello world ap works fine. When I put test files under that directory, works fine.. when I want to view my new rreport/index.html file - nothing. Tomcat is not recognizing it. I'm obviously missing something. Is there some other place that I need to tell Tomcat to look at my rreport folder?

Anyone configured Tomcat4 using the standard install from the application manager? What else do I need to do to get Tomcat to read from my rreport folder? Any help would be appreciated.

Thanks,
Mary

Puppet
05-19-2007, 09:34 AM
I'm having the same exact issue.

Maybe someone can answer Mary's question and mine. I'm having the same difficulies with adding a folder under webapps and having pages in it rendered by a browser. Any file loads from the hello world directory \hw but not from any newly added directories.


:confused: :(

Puppet
05-19-2007, 11:36 AM
I've read the previous posts about this and am till having problems. I'm a complete newbie to Tomcat.. never used it before. I need to add a new directory under webapps called rreport. Here's what I've done..

added new directory under webapps called rreport (put an index.html file in to test)

added "JkMount /rreport/* ajp13" to etc/httpd/conf/mod_jk.conf

added "<Context path="/var/tomcat4/webapps/rreport" docBase="rreport" debug="0" reloadable="true"> " to etc/tomcat4/server.xml

the hello world ap works fine. When I put test files under that directory, works fine.. when I want to view my new rreport/index.html file - nothing. Tomcat is not recognizing it. I'm obviously missing something. Is there some other place that I need to tell Tomcat to look at my rreport folder?

Anyone configured Tomcat4 using the standard install from the application manager? What else do I need to do to get Tomcat to read from my rreport folder? Any help would be appreciated.

Thanks,
Mary

Restart your tomcat server or the virtual server after making both of those configuration file changes.

What worked for me in the server.xml file is the code below. You may want to try this if restarting your virtual server with the entries you've already made in the config files don't work 100%. I think your error message will change from a web server/browser 404 to a Tomcat server 404 with the entries as is. If that's the case then you may want to change the server.xml entry to be similar to the one below:

<Context path="/test1" docBase="test1" debug="0" reloadable="true" crossContext="true" />

I left out the /var/tomcat4/webapps. Also, make sure you use /> (a slash and greater than sign) to close the tag entry and the context entry should be added to the server.xml file in-between the <host> </host> tags.

The first line you posted that's entered into the mod_jk.conf file is fine and needs no changes. Just remember to re-start your virtual server after you make these entries so tomcat re-reads the files you just modified and uses the new parameters.