Ok folks, I need some help or my frustration level is going to go through
the roof.

The system:
Mandrake 7.2, java 1.3, tomcat 3.1, Ant 1.2.



The problem:
Has anyone been able to build the sample app that is in the
doc/appdev/sample directory?  I can not get the servlet to run with apache.
If I try and access http://localhost/myapp/hello I get a page not found.
http://localhost:8080/myapp/hello works, as does
http://localhost/myapp/servlet/HelloServlet although the image does not show
up correctly because it's looking in /myapp/servlet/images not /myapp/images
which is understandable.  As far as I understand it you should be able to
map /hello to /servlet/HelloServlet.  Is this not correct?  I'm hoping
someone knows that one line that I have to put in tomcat-apache.conf to make
this work.



Here are some of the conf files:

conf/server.xml ( part of it anyways )
        <Context path="/myapp" docBase="webapps/myapp" debug="0"
reloadable="true" >
        </Context>


doc/appdev/sample/etc/web.xml (This is where I thought the magic would
happen, and the mapping would take place)

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

    <display-name>Hello, World Application</display-name>
    <description>
        This is a simple web application with a source code organization
        based on the recommendations of the Application Developer's Guide.
    </description>

    <servlet>
        <servlet-name>HelloServlet</servlet-name>
        <servlet-class>Hello</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloServlet</servlet-name>
        <url-pattern>/hello</url-pattern>
    </servlet-mapping>

</web-app>


conf/tomcat-apache.conf ( This is what gets generated anyways )

LoadModule jserv_module libexec/mod_jserv.so
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice

ApJServDefaultPort 8007

AddType test/jsp .jsp
AddHandler jserv-servlet .jsp
Alias /myapp /usr/local/jakarta-tomcat/webapps/myapp
<Directory "/usr/local/jakarta-tomcat/webapps/myapp">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /myapp/servlet /myapp
<Location /myapp/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

Alias /examples /usr/local/jakarta-tomcat/webapps/examples
<Directory "/usr/local/jakarta-tomcat/webapps/examples">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /examples/servlet /examples
<Location /examples/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

Alias /test /usr/local/jakarta-tomcat/webapps/test
<Directory "/usr/local/jakarta-tomcat/webapps/test">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /test/servlet /test
<Location /test/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

ApJServMount /servlet /ROOT


Thanks for your help.
sb

Reply via email to