Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Named based virtual host redirection

Darren Kukulka

2007-03-06

Replies:

Hi there



I'm doing some testing of redirection with a separate Apache web farm
serving front end redirection of specific tags to Tomcat server via an
ajp13 worker.



The problem I'm coming across is redirecting a DNS alias to a specific
tag on the same web server. I've been trying virtual host directives,
to no avail (the ajp13 redirection works for normal tags). The
configuration is as follows;



httpd.conf



LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkShmFile   logs/mod_jk.shm

JkLogFile   logs/mod_jk.log

JkLogLevel   info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkMount /app1/* worker1

ServerName fred.abc.co.uk

DocumentRoot "D:/Apache2/htdocs"

Include conf/extra/httpd-vhosts.conf



httpd-vhosts.conf



NameVirtualHost 1.2.3.4:80



<VirtualHost 1.2.3.4:80>

  DocumentRoot d:/apache2/htdocs

  ServerName test.abc.co.uk

  Redirect / http://fred.abc.co.uk/app1/

</VirtualHost>



workers.properties



worker.list=worker1

worker.worker1.type=ajp13

worker.worker1.host=1.2.3.5

worker.worker1.port=8009



Now if I hit the http://fred.abc.co.uk/app1/ without the vhosts include,
the site comes up...great!  If I include the vhosts, and try to hit
http://test.abc.co.uk <http://test.abc.co.uk/> without an appended
/app1/ tag (this is what I'm trying to achieve) to get the same site, I
get nothing at all....in fact, it times out. In the Apache web server
logs all I see is a recursive get on /app1/. Also, the original URL
does not work any more.



This seems to be a simple requirement but it is not proving to be
straightforward.



Can anybody help, or point me in the right direction?



Darren Kukulka

IT Infrastructure Consultant

Conntrol

Connaught PLC






Connaught honoured AIM 'Decade of Excellence' Award

Connaught awarded Partnering Contractor of the Year 2005

Connaught wins AIM 'Company of the Year' award 2004

West of England Business of the Year Award Winner 2003

Why not visit our website http://www.connaught.plc.uk
Disclaimer:

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete this message.



Connaught plc, Head Office 01392 444546
©2008 junlu.com - Jax Systems, LLC, U.S.A.