tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heather Buch" <hb...@www.thebuchs.dk>
Subject jkmounts screwing up my namevirtualhost
Date Fri, 27 Jun 2003 11:14:54 GMT
Hello,

My NameVirtualHost fails when I try to set the JkMount directives.

I am using
httpd-2.0.43
jakarta-tomcat-4.1.12
(I am also using jakarta-struts-1.0.2, but this might not be so relevant to my
problem)

Here is my setup (I describe the problem at the end using the specific names
that appear in the config file snippets below):

1. in /etc/hosts:

 # Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
127.0.0.1               oecon-stprg
127.0.0.1               oecon-admprg
12.38.84.60             heather

2. In httpd.conf:

NameVirtualHost 127.0.0.1

Here is my "catch all" localhost virtual host:

<VirtualHost 127.0.0.1>
ServerAdmin admin@localhost
ServerAlias localhost.localdomain localhost
DocumentRoot "/usr/local/bin/server-1.0/apache2/htdocs"
ServerName localhost
ErrorLog logs/localhost_error.log
CustomLog logs/localhost_access.log common
</VirtualHost>

3. in mod_jk.conf-local 

Here is the virtual host that I am trying to work with:

<VirtualHost 127.0.0.1>
DocumentRoot
"/usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/webapps/oecon-stprg/"
ServerName oecon-stprg
ServerAlias oecon-stprg
ServerAdmin hbuch@thebuchs.dk

# Deny direct access to WEB-INF and META-INF
<Location "WEB-INF/*">
    AllowOverride None
    deny from all
</Location>
<Location "META-INF/*">
     AllowOverride None
     deny from all
 </Location>
<Directory "/usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/webapps/oecon-stprg">
    Options Indexes FollowSymLinks
	order	allow,deny
	allow	from all
    DirectoryIndex login.jsp 
</Directory>

JkMount /*.do ajp13
JkMount /servlet/*.jsp ajp13
JkMount /*.jsp ajp13

#ErrorLog logs/oecon-stprg_error.log
#CustomLog logs/oecon-stprg_access.log common
</VirtualHost>


----------------------

The problem is - when I call up my virtual host url (http://oecon-stprg) and
comment out the JkMount directives, apache gives me the proper document root
("/usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/webapps/oecon-stprg/") but
of course then Tomcat can't handle jsp pages because there are no JkMount
directives. When I uncomment the JkMounts and call up my virtual host, Apache
does not send me to the DocumentRoot that I have defined in my oecon-stprg
VirtualHost, but instead to the default tomcat webapp.

In other words, the presence of this in my VirtualHost block: 

JkMount /*.do ajp13
JkMount /servlet/*.jsp ajp13
JkMount /*.jsp ajp13

causes Apache to deliver the files under here:

/usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/webapps/ROOT

intead of the ones under here:

/usr/local/bin/server-1.0/jakarta-tomcat-4.1.12/webapps/oecon-stprg

I hope I have explained this well enough to get a reply. I have struggled for
two days now. I read the document at
http://www.galatea.com/flashguides/virtual-hosting.xml as I generally think
the Galatea guides are very good. However, it describes setting up the
JkMounts under a subdirectory, for example,

JkMount /test ajp13
JkMount /test/* ajp13

and not at the root, as I would like to do. I want to be able to call up

http://oecon-stprg/login.jsp

not  

http://oecon-stprg/test/login.jsp

but maybe I need that subdirectory?

Thanks very much in advance,

Heather Buch


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message