You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jean-Paul Abgrall <Je...@Phoenix.com> on 2000/07/22 03:38:29 UTC

Apache+JServ112+Tomcat or "AddHandler jserv-servlet..." and mul tiple ApJServMount problem

The problem summary is that the jserv-servlet (mod_jserv) handler can not
explicitly distinguish multiple servlet containers. 

In the following example, 
to which servlet container will //localhost/test.jsp go?
  localhost:8007 or localhost:8008?

vvvvvvvv
AddType text/jsp .jsp
AddHandler jserv-servlet .jsp
# Some Tomcat servlets
ApJServMount /servlets8 ajpv12://localhost:8008
# Some JServ112 servlets
ApJServMount /servlets7 ajpv12://localhost:8009
^^^^^^^^


Well it seems that mod_jserv will allow the handler to change its port only
once from 'default' to something else. So in the example above all .jsp
pages will go to 8008.
If the ApJServMount lines were reversed then the .jsp pages would go to
8009.

The reason why I'm bringing this up is because I needed to setup JServ112
(for legacy servlets) *AND* Tomcat. But I did not want to use the tomcat
server (8080). 

(One Solution) So I did the following to get this to work:

vvvvvvvv
# !! THIS MUST BE LOADED BEFORE THE NORMAL JSERV servlet container !!
AddType text/jsp .jsp
AddHandler jserv-servlet .jsp
Alias /reseller /local/reseller
<Directory "/local/reseller">
    Options Indexes FollowSymLinks
</Directory>
<Location /reseller/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

#<set_port_for_jserv-servlet_handler>
# MEGA-HACK: activate the port 8008 for the jserv-servlet handler
# Don't ask me why... but from the mod_jserv code it seems like
#  only one jserv-servlet handler can exist, and the port for the handler
#  can only be changed once from default_port to something else.
#  So I setup the handler for .jsp then I force the port change.
# This port change affects only the handler. The other mount points
#  that are mounted later will still use the default port because each
#  mount point can have its own.
#

# If this mountpoint were for real then servlets within it would
#  be handled by tomcat. But we only care about jsp for now.
ApJServMount /dummyName ajpv12://localhost:8008/dummyName2
#</set_port_for_jserv-servlet_handler>


# This zone goes to JServ112 while .jsp files go to port 8008
ApJServMount /gz1.3.1 /gz1.3.1
^^^^^^^^

If anybody has a clean way of settingup Apache+JServ112+Tomcat
please share your wisdom.

(And add mod_dav to the equation: how will mod_dav copy a .jsp file without
invoking the servlet handler? Ha! Ha! Ha! I laugh at my incompetence)

jp