On Thu, 22 Feb 2001, Plough, Chris wrote:

>  
> I am moving from Apache/JServ to Apache/Tomcat.  With JServ, I could
> bind it to a single IP address, so that I could run multiple
> instances of it on a single server.  I would make changes in the
> jserv.conf and jserv.properties files to enable this.
> 
> I have searched through the Tomcat configuration files, but have been
> unable to find similar options.  I'm using Apache 1.3.17, Tomcat
> 3.2.1, and mod_jk.  I assume that I need to edit the mod_jk.conf and
> server.xml files, but don't know which options to add.  I searched
> through the mailing-list archives, but couldn't find an answer.  Any
> help is appreciated.
> 
> Thanks in advance!
> - --Chris


I am not sure if I understand you correctly... If you want to run
several Tomcats listening on different ports, this is what I would try.
Tell us if it worked, if you try it...

Let assume for the moment that you will use AJP13 protocol for communication
with Apache, but you will keep the AJP12 protocol for shutdown only.

1) create several server.xml files with different listening ports.
   For example:   
   ============================
      [servera.xml]
       ...................
        <!-- Apache AJP12 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="4006"/>
        </Connector>

        <!-- Apache AJP13 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
            <Parameter name="port" value="4007"/>
        </Connector>
       ....................
   ==============================   
   ============================
      [serverb.xml]
       ...................
        <!-- Apache AJP12 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="4008"/>
        </Connector>

        <!-- Apache AJP13 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
            <Parameter name="port" value="4009"/>
        </Connector>
       ....................
   ==============================   
   ============================
      [serverc.xml]
       ...................
        <!-- Apache AJP12 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="4010"/>
        </Connector>

        <!-- Apache AJP13 support. This is also used to shut down tomcat.
          -->
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler"
       value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
            <Parameter name="port" value="4011"/>
        </Connector>
       ....................
   ==============================   

2) start them as

      startup.sh -f servera.xml
      startup.sh -f serverb.xml
      startup.sh -f serverc.xml

3)  Then create workers.properties file and put there:

#
worker.ajp12a.port=4006
worker.ajp12a.host=localhost
worker.ajp12a.type=ajp12
worker.ajp12a.lbfactor=1 
#                           
#
worker.ajp13a.port=4007
worker.ajp13a.host=localhost
worker.ajp13a.type=ajp13
worker.ajp13a.lbfactor=1 
#                           

#
worker.ajp12b.port=4008
worker.ajp12b.host=localhost
worker.ajp12b.type=ajp12
worker.ajp12b.lbfactor=1 
#                           
#
worker.ajp13b.port=4009
worker.ajp13b.host=localhost
worker.ajp13b.type=ajp13
worker.ajp13b.lbfactor=1 
#                           

#
worker.ajp12c.port=4010
worker.ajp12c.host=localhost
worker.ajp12c.type=ajp12
worker.ajp12c.lbfactor=1 
#                           
#
worker.ajp13c.port=4011
worker.ajp13c.host=localhost
worker.ajp13c.type=ajp13
worker.ajp13c.lbfactor=1 
#                           
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12a,ajp13a,ajp12b,ajp13b,ajp12c,ajp13c

                                                       
4) Then create mod_jk.conf with the context assignments for the workers:


Alias /examplesa "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesa"
<Directory "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesa">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /examplesa/servlet/* ajp13a
JkMount /examplesa/*.jsp ajp13a

#
# The following line prohibits users from directly accessing WEB-INF
#
<Location "/examplesa/WEB-INF/">
    AllowOverride None
    deny from all
</Location>

#
# The following line prohibits users from directly accessing META-INF
#
<Location "/examplesa/META-INF/">
    AllowOverride None
    deny from all
</Location>
                           
Alias /examplesb "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesb"
<Directory "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesb">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /examplesb/servlet/* ajp13b
JkMount /examplesb/*.jsp ajp13b

#
# The following line prohibits users from directly accessing WEB-INF
#
<Location "/examplesb/WEB-INF/">
    AllowOverride None
    deny from all
</Location>

#
# The following line prohibits users from directly accessing META-INF
#
<Location "/examplesb/META-INF/">
    AllowOverride None
    deny from all
</Location>
                           
Alias /examples "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesc"
<Directory "/usr/local/tomcat_3.2.1/tomcat-3.2.1/webapps/examplesc">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /examplesc/servlet/* ajp13c
JkMount /examplesc/*.jsp ajp13c

#
# The following line prohibits users from directly accessing WEB-INF
#
<Location "/examplesc/WEB-INF/">
    AllowOverride None
    deny from all
</Location>

#
# The following line prohibits users from directly accessing META-INF
#
<Location "/examplesc/META-INF/">
    AllowOverride None
    deny from all
</Location>


================================
Jan K. Labanowski            |    phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center    |    Internet: [EMAIL PROTECTED] 
1224 Kinnear Rd,             |    http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163      |    http://www.osc.edu/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to