tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "The Wolf" <thew...@fastmail.fm>
Subject TC 4.1, JK2, Apache HTTP 1.3: virtual hosts with same name and different ports
Date Mon, 28 Apr 2003 09:28:12 GMT
Hello,

I am sending this message again to the list, hoping someone can help.

I am running Tomcat 4.1.24 on Red Hat Linux 7.3, Apache HTTPD 1.3.27 and
mod_jk2 2.0.2.

I have set up Apache HTTPD/Tomcat/JK2 virtual hosts following this
HOWTO:
<http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html>

I have a domain (e.g. www.mydomain.com) accessible via http (port 80) and
https (port 443).

I have configured two Apache HTTPD VirtualHosts with different
DocumentRoots (httpdocs and httpsdocs), since the http and https sites
have to serve different pages.

httpd.conf
***
<VirtualHost x.x.x.x:80>
ServerName www.mydomain.com
DocumentRoot /home/httpd/vhosts/mydomain.com/httpdocs
... cut ...
</VirtualHost>

<VirtualHost x.x.x.x:443>
ServerName www.mydomain.com
DocumentRoot /home/httpd/vhosts/mydomain.com/httpsdocs
... cut ...
</VirtualHost>
***


Here is the mod_jk2 config:

workers2.properties
***
[uri:www.mydomain.com:80/*.jsp]
worker=ajp13:localhost:8009

[uri:www.mydomain.com:443/*.jsp]
worker=ajp13:localhost:8009
***


Now I am trying to configure two Tomcat Hosts, but it seems that Tomcat
doesn't support the port number in the Host's name.

Here is the Tomcat config:

server.xml
***
<Host className="org.apache.catalina.core.StandardHost"
appBase="/home/httpd/vhosts/mydomain.com/httpdocs" autoDeploy="true"
configClass="org.apache.catalina.startup.ContextConfig"
contextClass="org.apache.catalina.core.StandardContext" debug="0"
deployXML="true"
errorReportValveClass="org.apache.catalina.valves.ErrorReportValve"
liveDeploy="true"
mapperClass="org.apache.catalina.core.StandardHostMapper"
name="www.mydomain.com:80" unpackWARs="true">
<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
cookies="true" crossContext="false" debug="0" docBase=""
mapperClass="org.apache.catalina.core.StandardContextMapper" path=""
privileged="false" reloadable="true" swallowOutput="false"
useNaming="false"
wrapperClass="org.apache.catalina.core.StandardWrapper">
</Context>
</Host>

<Host className="org.apache.catalina.core.StandardHost"
appBase="/home/httpd/vhosts/mydomain.com/httpsdocs" autoDeploy="true"
configClass="org.apache.catalina.startup.ContextConfig"
contextClass="org.apache.catalina.core.StandardContext" debug="0"
deployXML="true"
errorReportValveClass="org.apache.catalina.valves.ErrorReportValve"
liveDeploy="true"
mapperClass="org.apache.catalina.core.StandardHostMapper"
name="www.mydomain.com:443" unpackWARs="true">
<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
cookies="true" crossContext="false" debug="0" docBase=""
mapperClass="org.apache.catalina.core.StandardContextMapper" path=""
privileged="false" reloadable="true" swallowOutput="false"
useNaming="false"
wrapperClass="org.apache.catalina.core.StandardWrapper">
</Context>
</Host>
***

It seems that Tomcat doesn't like the port number in the
Host's name: the .jsp requests will not go to the mydomain.com virtual
hosts, they will go to the defaultHost for the Engine defined in the
server.xml file.

How can I configure Tomcat with two virtual hosts with the same name and
different port?

Is it a known limitation?

Thanks in advance.

-- 
http://www.fastmail.fm - Access your email from home and the web

---------------------------------------------------------------------
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