Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache/tomcat - apache shows dir listing but when when jsp clicked...

Status
Not open for further replies.

excession

Programmer
Joined
Sep 22, 2004
Messages
111
Location
GB
Hi.

This is starting to drive me mad!

I have apache2 and tomcat5 with mod_jk.

If I enter a url eg apache returns a directory listing. If I click on the index.jsp file tomcat then serves the content correctly.

If I go to the url with then all is fine.

Two questions:
1) What could be wrong and how can I fix it?
2) Why didn't I get a job as a gardener?
 
Not sure about Apache, but in Tomcat :

To get Tomcat to serve up a default page when some goes to your webapp root, edit your webapp's web.xml :

Code:
<welcome-file-list>
        <welcome-file>my_index.jsp</welcome-file>
        <welcome-file>a_backup_page.jsp</welcome-file>

</welcome-file-list>

To turn off directory listings in Tomcat altogether, edit TOMCAT_HOME/conf/web.xml (the gloabl web.xml, not your webapp's one) and find the "default" servlet entry. Change :

Code:
        <init-param>
            <param-name>listings</param-name>
            <param-value>true</param-value>
        </init-param>
to :
Code:
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Ah, I think this is the crux of the problem. Tomcat is fine, hence when I specify the 8080 port all is ok. The problem seems to be that apache isn't forwarding the jsp pages to tomcat correctly.

When I get the dir listing, it isn't from tomcat - it's apache.

I try a post on the apache forum as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top