Tomcat6 map subdomain to particular directory under web root

2008-07-18 Thread kazukin6

server.xml
  
w1.localhost
  

Using alias "w1.localhost" maps subdomain to web root directory
Is there any trick to map w1.localhost to localhost/w1 directory?
-- 
View this message in context: 
http://www.nabble.com/Tomcat6-map-subdomain-to-particular-directory-under-web-root-tp18531402p18531402.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat6 map subdomain to particular directory under web root

2008-07-18 Thread kazukin6


Caldarale, Charles R wrote:
> 
> You can use Tuckey's URL rewrite filter (http://tuckey.org/urlrewrite/) or
> you could use virtual hosts: instead of the , define a second
>  with an appBase pointing to the desired directory.
>  - Chuck
> 

Chuck, thanks a lot!
1)  I didnt manage to get the second host working, tomcat just won't find
any pages/resources and returns empty pages. Adding context element
  seems to fix that
problem, but in this case it looks like it's working in separate context
(none of the java classes from WEB-INF/classes can be used)
2) Tuckey's URL rewrite  does work! But I'm not sure about performance
overheads, compared to using Apache WebServer with Virtual Hosts.
For those who concern, here is the sample rule (from urlrewrite.xml)


subdomains redirect

w1.localhost
/admin/(.*)
/w1/(.*)
^/(.*)
/w1/$1



-- 
View this message in context: 
http://www.nabble.com/Tomcat6-map-subdomain-to-particular-directory-under-web-root-tp18531402p18536559.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]