tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Murthi <mur...@fnal.gov>
Subject Re: different port to have different base directory
Date Thu, 24 Jul 2003 16:54:45 GMT
Thanks Simon. I added two services instead and it works!!!!

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN" debug="0">

  <!-- Comment these entries out to disable JMX MBeans support -->
  <!-- You may also configure custom components (e.g. Valves/Realms) by
       including your own mbean-descriptor file(s), and setting the
       "descriptors" attribute to point to a ';' seperated list of paths
       (in the ClassLoader sense) of files to add to the default list.
       e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
  -->
  <Listener debug='0' 
className='org.apache.catalina.mbeans.ServerLifecycleListener'/>
  <Listener debug='0' 
className='org.apache.catalina.mbeans.GlobalResourcesLifecycleListener'/>
  <!-- Global JNDI resources -->
  <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name='simpleValue' type='java.lang.Integer' value='30'/>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name='UserDatabase' 
type='org.apache.catalina.UserDatabase' description='User database that 
can be updated and saved' auth='Container'>
    </Resource>
    <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>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" (and therefore the web applications visible
       within that Container).  Normally, that Container is an "Engine",
       but this is not required.

       Note:  A "Service" is not itself a "Container", so you may not
       define subcomponents such as "Valves" or "Loggers" at this level.
   -->
  <Service name="Tomcat-nonSSL">
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="7081" minProcessors="5" maxProcessors="10"
               enableLookups="true" redirectPort="443" acceptCount="10"
               debug="0" connectionTimeout="60000" scheme="http"
               secure="false"/>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.MemoryRealm"/>
      <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs" prefix="localhost_access_log."
               suffix=".txt" pattern="common"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
                directory="logs" prefix="localhost_log." suffix=".txt"
                timestamp="true"/>
        <Context path="" docBase="ROOT" debug="0"/>
      </Host>
    </Engine>
  </Service>

  <Service name="Tomcat-SSL">
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="9443" minProcessors="5" maxProcessors="75"
               enableLookups="true"
           acceptCount="100" debug="20" scheme="https" secure="true"
               useURIValidationHack="false" disableUploadTimeout="true">
      <Factory 
className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
           keystoreFile="/home/murthi/.keystore"
           keystorePass="changeit"
               clientAuth="true" protocol="TLS" />
    </Connector>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
    <Logger className="org.apache.catalina.logger.FileLogger"
        prefix="catalina_SSLlog." suffix=".txt" timestamp="true"/>
    <Realm className="org.apache.catalina.realm.MemoryRealm"/>
    <Host name="localhost" debug="0" appBase="secureapps" unpackWARs="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"
               directory="logs" prefix="localhost_access_SSLlog."
               suffix=".txt" pattern="common"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
                directory="logs" prefix="test_localhost_log." suffix=".txt"
                timestamp="true"/>
        <Context path="" docBase="test" debug="0"/>
     </Host>
    </Engine>
  </Service>

</Server>


Cheers,
Vijay.




Simon Pabst wrote:

> forgot, you need to put that -f configfile stuff into two different 
> shutdown.sh's too
> (i personally don't use the shutdown mechanism for stopping Tomcats, a 
> kill -9 works better ;-)
>
>
> At 01:08 24.07.2003 +0200, you wrote:
>
>> One tomcat with HTTP and HTTPS connector would be the simplest solution,
>> just it won't work with the same context having two different 
>> directories (AFAIK).
>>
>> So either you use one tomcat and server.xml with two different 
>> Contexts, or
>> you have use one tomcat installation, 2 different server.xml's, 2 
>> different startup.sh's:
>>
>> conf/http_server.xml: HTTP Connector on 7080, shutdown port, context 
>> localservlet -> $CATALINA_HOME/webapps/
>> conf/https_server.xml: HTTPS Connector on 7081, different shutdown 
>> port, context localservlet -> $CATALINA_HOME/secuareapps/
>>
>> Modify last line of startup.sh:
>> bin/http_startup.sh: exec "$PRGDIR"/"$EXECUTABLE" start -f 
>> "${PRGDIR}/../conf/http_server.xml" "$@"
>> bin/https_startup.sh: "$PRGDIR"/"$EXECUTABLE" start -f 
>> "${PRGDIR}/../conf/https_server.xml" "$@"
>>
>> Or leave startup.sh as it is and put the following into your tomcat 
>> init script(s).
>> startup.sh -f /path/to/tomcat/conf/http[s]server.xml"
>>
>>
>> See http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html
>> for SSL/HTTPS configuration
>>
>>
>> At 17:06 23.07.2003 -0500, you wrote:
>>
>>> Hi,
>>>
>>> I successfully configured tomcat for mutual authentication.
>>>
>>> I would like to start tomcat server with 2 connectors listening at
>>>
>>> http://localhost:7080
>>> https://localhost:7081
>>>
>>> But both of them should use different base directory. i.e., when I 
>>> invoke
>>>
>>> http://localhost:7080/localservlet
>>>
>>> from my browser, tomcat should try to find this servlet in 
>>> "$CATALINA_HOME/webapps/" location.
>>>
>>> and if I invoke using https
>>>
>>> https://localhost:7081/localservlet
>>>
>>> it should try to find this servlet in "$CATALINA_HOME/secuareapps/" 
>>> location.
>>>
>>> Is there any way of doing this without using virual hosts 'cuz I 
>>> want the same hostname.
>>> Based on the port number (7080/7081) (or) protocol(http/https) they 
>>> should have different base root directory i.e., for example
>>> I also do not want connections coming from http have access to look 
>>> into secureapps directory and https have access to webapps.
>>>
>>> Have anybody tried this?
>>>
>>> Thanks,
>>> Vijay.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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