tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: newbie: multiple ports for same tomcat server 5.0
Date Thu, 21 Jan 2010 19:33:12 GMT
Chart wrote:
> I have recently inherted a tomcat 5 server (today - do want want to upgrade
> at this point).   There is a SSI server on the outside that sends request to
> 8009 for this tomcat server (from what I have been told).   The tomcat
> server is running on port 8082.   I have been tasked to change this tomcat
> server to accept request from 8082 when they are coming from the outside and
> port 80 if you are inside the network.  The outisde goes from an address
> that accepts the request on port 80 and then sends it to tomcat on port
> 8082.   The inside I would set DHCP to send directly to the tomcat server
> and by pass the SSI server.   Therefore I need to allow this tomcat server
> to listen on port 80 and port 8082.
> I am including my server.xml file.  
> 
> Thanks,
> 
> <?xml version='1.0' encoding='utf-8'?>
> <Server>
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
>   <GlobalNamingResources>
>     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
>     <Resource auth="Container" description="User database that can be
> updated and saved" name="UserDatabase"
> type="org.apache.catalina.UserDatabase"/>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
>         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
>   </GlobalNamingResources>
>   <Service name="Catalina">
>     <Connector URIEncoding="UTF-8" acceptCount="100"
> connectionTimeout="20000" disableUploadTimeout="true" port="8082"
> redirectPort="8443" maxSpareThreads="75" maxThreads="150"
> minSpareThreads="25">
>     </Connector>
>     <Connector port="8009" protocol="AJP/1.3"
> protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
> redirectPort="8443" tomcatAuthentication="false">
>     </Connector>
>     <Engine defaultHost="localhost" name="Catalina">
>       <Host appBase="webapps" name="localhost">
>         <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="localhost_log." suffix=".txt" timestamp="true"/>
>       </Host>
>       <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="catalina_log." suffix=".txt" timestamp="true"/>
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
>     </Engine>
>   </Service>
> </Server>
> 

Finally a question at my level ! :-)

What you have above, graphically (*), is like this :

Users     Users             Users          Users
   |          |                |              |
   |          |                |              |
   |          |                |
   (HTTP protocol)              (HTTP protocol)
    SSI server                          |
   (Apache httpd ?)                     |
     |                                  |
Apache/Tomcat connector                |
(inside Apache)                        |
(mod_jk ?)                             |
     |                                  |
(AJP protocol)
Tomcat AJP connector              Tomcat HTTP connector
<Connector port=8009>              <Connector port=8082>
     |----------------------------------|
                             |
                         Tomcat <Host>
                             |
                   ----------------------
                   |     |      |       |
                  webapps    webapps  webapps



And you want this :

Users     Users          External Users         Internal Users
   |          |                |                      |
   |          |                |                      |
    |         |                |                      |
   (HTTP protocol)       (HTTP protocol)          (HTTP protocol)
    SSI server                 |                      |
   (Apache httpd ?)            |                      |
     |                         |                      |
Apache/Tomcat connector       |                      |
(inside Apache)               |                      |
(mod_jk ?)                    |                      |
     |                         |                      |
Tomcat AJP connector   Tomcat HTTP connector    Tomcat HTTP connector
<Connector port=8009>  <Connector port=8082>    <Connector port=80>
     |                                                |
     |-------------------------------------------------
                             |
                         Tomcat Host
                             |
                   ----------------------
                   |     |      |       |
                  webapps    webapps  webapps


Can you guess ?



You just need to duplicate this section, and change one attribute :
 >     <Connector URIEncoding="UTF-8" acceptCount="100"
 > connectionTimeout="20000" disableUploadTimeout="true" port="8082"
 > redirectPort="8443" maxSpareThreads="75" maxThreads="150"
 > minSpareThreads="25">
 >     </Connector>

Easy, no ?



(*) Well, I am doing my best, but there's a limit to what one can do in 
text emails


Note that there is a catch, above : if there is already another server 
listening on port 80, it will not work. You need to choose, only one 
server listening on each port is allowed.

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


Mime
View raw message