mod_jk and URL mapping problem?

2001-09-05 Thread Paul Downs

Hi,
  Greetings all, first post to this list from a Tomcat newbie(ish).  I have 
been setting up tomcat, using mod_jk on Linux, on quite a few machines and 
have this problem:

   Each virtual host has quite a few different domains in ServerAliases 
e.g.:

VirtualHost 217.158.17.27:80
DocumentRoot /home/user/public_html
ServerName www.domain.org
ServerAlias domain.org eco.domain.org www.domain.com domain.com
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
/VirtualHost

   And in server.xml I have this entry:

Host name=www.domain.org
  Context path= docBase=/home/user/public_html debug=0/
/Host
   Amongst others

   My problem is that jsp/servlets is not parsed/accepted for domains/urls 
that are not mentioned in the Host entry.  I end up having to have multiple 
entries for each entry in ServerAlias'.  So the question is, am I being 
stupid?
   The reason this is a bugbear is some jsp sites have loads of entries in 
ServerAlias and keeping track of them is awkward and makes the config file 
rather long!

Thanks,  hope to be able to contribute some answers myself soon!

Paul



RE: mod_jk and URL mapping problem?

2001-09-05 Thread Larry Isaacs

Hi Paul,

I assume you are using a version of Tomcat 3.2.x.
If you are willing to give Tomcat 3.3 a try, Tomcat 3.3b2
has support for virtual host aliases. The syntax is:

server
host name=www.domain.org address=217.158.17.27:80 
alias name=domain.org /
alias name=www.domain.org /
alias name=domain.com /
alias name=www.domain.com /
Context path= docBase=/home/user/public_html
debug=0/
/host
/server

You do not need to put this in your server.xml.  Put it in a
file whose name begins with apps- and has an .xml extension,
such as apps-vhosts.xml.

Starting with 3.3b2, you must start Tomcat with a jkconf
option to have the auto-generated config files written.
This will initialize Tomcat, write the config files, and
exit.  This may be done while Tomcat is already running as
as server.  This change deals with the issue of having Tomcat
and Apache as services, and Tomcat rewriting the config file
while Apache tries to read it.

There are numerous other improvements, many of which are
documented in the updated tomcat-ug.html. An on-line
version is at:

http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html

Unfortunately the mod_jk-howto.html has not yet been updated
with information about this feature.

Cheers,
Larry


 -Original Message-
 From: Paul Downs [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 05, 2001 8:06 AM
 To: Tomcat Mailing List
 Subject: mod_jk and URL mapping problem?
 
 
 Hi,
   Greetings all, first post to this list from a Tomcat 
 newbie(ish).  I have 
 been setting up tomcat, using mod_jk on Linux, on quite a few 
 machines and 
 have this problem:
 
Each virtual host has quite a few different domains in 
 ServerAliases 
 e.g.:
 
 VirtualHost 217.158.17.27:80
 DocumentRoot /home/user/public_html
 ServerName www.domain.org
 ServerAlias domain.org eco.domain.org www.domain.com 
 domain.com
 ErrorDocument 404 /404.html
 ErrorDocument 403 /403.html
 JkMount /*.jsp ajp13
 JkMount /servlet/* ajp13
 /VirtualHost
 
And in server.xml I have this entry:
 
 Host name=www.domain.org
   Context path= docBase=/home/user/public_html 
 debug=0/
 /Host
Amongst others
 
My problem is that jsp/servlets is not parsed/accepted for 
 domains/urls 
 that are not mentioned in the Host entry.  I end up having to 
 have multiple 
 entries for each entry in ServerAlias'.  So the question is, 
 am I being 
 stupid?
The reason this is a bugbear is some jsp sites have loads 
 of entries in 
 ServerAlias and keeping track of them is awkward and makes 
 the config file 
 rather long!
 
 Thanks,  hope to be able to contribute some answers myself soon!
 
 Paul