tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Holmes" <david_m_hol...@yahoo.com>
Subject Re: Documentation on virtual hosting?
Date Fri, 28 Jul 2000 16:07:15 GMT
I believe my setup does what you require. I have included my tomcat.conf and a couple of my
server.xml files as an example...

tomcat.conf
###############################################################################
#                     Apache JServ Configuration File                         #
###############################################################################

# move to httpd.conf
Alias /shared D:/Inetpub/webs/shared
Options -Indexes
DirectoryIndex default.htm default.jsp
ServerAdmin david_m_holmes@reliantenergy.com

# Tell Apache on win32 to load the Apache JServ communication module
LoadModule jserv_module modules/ApacheModuleJServ.dll

<IfModule mod_jserv.c>
# Do not edit! 
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice

### Change if you run tomcat on a different host
# ApJServDefaultHost localhost
AddType text/jsp .jsp
AddHandler jserv-servlet .jsp

############################# Apache virtual host config ##########################
NameVirtualHost 10.12.9.4

<VirtualHost 10.12.9.4>
	ServerName dev.ilca.hlp.reliantenergy.com
	DocumentRoot D:/Inetpub/webs/dev/dev.ilca.hlp.reliantenergy.com
	ApJServDefaultPort 8007
	ApJServMount /servlet /root
	ErrorLog logs/error_dev.ilca.hlp.reliantenergy.com.log
	CustomLog logs/access_dev.ilca.hlp.reliantenergy.com.log common
</VirtualHost>

<VirtualHost 10.12.9.4>
	ServerName ilca.hlp.reliantenergy.com
	DocumentRoot D:/Inetpub/webs/prod/ilca.hlp.reliantenergy.com
	ApJServDefaultPort 8008
	ApJServMount /servlet /root
	ErrorLog logs/error_ilca.hlp.reliantenergy.com.log
	CustomLog logs/access_ilca.hlp.reliantenergy.com.log common
</VirtualHost>

<VirtualHost 10.12.9.4>
	ServerName dev.ebusiness.reliantenergy.com
	DocumentRoot D:/Inetpub/webs/dev/dev.ebusiness.reliantenergy.com
	ApJServDefaultPort 8009
	ApJServMount /servlet /root
	ErrorLog logs/error_dev.ebusiness.reliantenergy.com.log
	CustomLog logs/access_dev.ebusiness.reliantenergy.com.log common
</VirtualHost>

<VirtualHost 10.12.9.4>
	ServerName ebusiness.reliantenergy.com
	DocumentRoot D:/Inetpub/webs/prod/ebusiness.reliantenergy.com
	ApJServDefaultPort 8010
	ApJServMount /servlet /root
	ErrorLog logs/error_ebusiness.reliantenergy.com.log
	CustomLog logs/access_ebusiness.reliantenergy.com.log common
</VirtualHost>

<VirtualHost 10.12.9.4>
	ServerName dev.enform.reliantenergy.com
	DocumentRoot D:/Inetpub/webs/dev/dev.enform.reliantenergy.com
	ApJServDefaultPort 8011
	ApJServMount /hlp/ma root
	ApJServMount /servlet /root
	ErrorLog logs/error_dev.enform.reliantenergy.com.log
	CustomLog logs/access_dev.enform.reliantenergy.com.log common
</VirtualHost>

</IfModule>

1 server.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<Server>
    <!-- Debug low-level events in XmlMapper startup -->
    <xmlmapper:debug level="0" />

    <!-- This is quite flexible; we can either have a log file per
         module in Tomcat (example: ContextManager) or we can have
         one for Servlets and one for Jasper, or we can just have
	 one tomcat.log for both Servlet and Jasper.

	 If you omit "path" there, then stderr should be used.

	 verbosityLevel values can be: 
	    FATAL
	    ERROR
	    WARNING 
            INFORMATION
            DEBUG
         -->

    <Logger name="tc_log" 
            path="logs/tomcat_dev.ebusiness.reliantenergy.com.log"
            customOutput="yes" />

    <Logger name="servlet_log" 
            path="logs/servlet_dev.ebusiness.reliantenergy.com.log"
            customOutput="yes" />

    <Logger name="JASPER_LOG" 
	    path="logs/jasper_dev.ebusiness.reliantenergy.com.log"
            verbosityLevel = "INFORMATION" />

    <!-- Add "home" attribute if you want tomcat to be based on a different directory
         "home" is used to create work and to read webapps, but not for libs or CLASSPATH.
         Note that TOMCAT_HOME is where tomcat is installed, while ContextManager home is
the
         base directory for contexts, webapps/ and work/
      -->
    <ContextManager debug="0" workDir="work_dev.ebusiness.reliantenergy.com" >
        <!-- ContextInterceptor className="org.apache.tomcat.context.LogEvents" / -->
        <ContextInterceptor className="org.apache.tomcat.context.AutoSetup" />
        <ContextInterceptor className="org.apache.tomcat.context.DefaultCMSetter" />
        <ContextInterceptor className="org.apache.tomcat.context.WorkDirInterceptor" />
        <ContextInterceptor className="org.apache.tomcat.context.WebXmlReader" />
        <ContextInterceptor className="org.apache.tomcat.context.LoadOnStartupInterceptor"
/>
        <!-- Request processing -->
        <RequestInterceptor className="org.apache.tomcat.request.SimpleMapper" debug="0"
/>
        <RequestInterceptor className="org.apache.tomcat.request.SessionInterceptor" />
        <RequestInterceptor className="org.apache.tomcat.request.SecurityCheck" />
        <RequestInterceptor className="org.apache.tomcat.request.FixHeaders" />

        <!-- <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="80"/>
        </Connector> -->

        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="8009"/>
        </Connector>

        <!-- example - how to override AutoSetup actions -->
        <Context path="" docBase="d:/inetpub/webs/dev/dev.ebusiness.reliantenergy.com"
debug="0"
reloadable="true" > 
        </Context>
		
    </ContextManager>
</Server>

2 server.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<Server>
    <!-- Debug low-level events in XmlMapper startup -->
    <xmlmapper:debug level="0" />

    <!-- This is quite flexible; we can either have a log file per
         module in Tomcat (example: ContextManager) or we can have
         one for Servlets and one for Jasper, or we can just have
	 one tomcat.log for both Servlet and Jasper.

	 If you omit "path" there, then stderr should be used.

	 verbosityLevel values can be: 
	    FATAL
	    ERROR
	    WARNING 
            INFORMATION
            DEBUG
         -->

    <Logger name="tc_log" 
            path="logs/tomcat_dev.enform.reliantenergy.com.log"
            customOutput="yes" />

    <Logger name="servlet_log" 
            path="logs/servlet_dev.enform.reliantenergy.com.log"
            customOutput="yes" />

    <Logger name="JASPER_LOG" 
	    path="logs/jasper_dev.enform.reliantenergy.com.log"
            verbosityLevel = "INFORMATION" />

    <!-- Add "home" attribute if you want tomcat to be based on a different directory
         "home" is used to create work and to read webapps, but not for libs or CLASSPATH.
         Note that TOMCAT_HOME is where tomcat is installed, while ContextManager home is
the
         base directory for contexts, webapps/ and work/
      -->
    <ContextManager debug="0" workDir="work_dev.enform.reliantenergy.com" >
        <!-- ContextInterceptor className="org.apache.tomcat.context.LogEvents" / -->
        <ContextInterceptor className="org.apache.tomcat.context.AutoSetup" />
        <ContextInterceptor className="org.apache.tomcat.context.DefaultCMSetter" />
        <ContextInterceptor className="org.apache.tomcat.context.WorkDirInterceptor" />
        <ContextInterceptor className="org.apache.tomcat.context.WebXmlReader" />
        <ContextInterceptor className="org.apache.tomcat.context.LoadOnStartupInterceptor"
/>
        <!-- Request processing -->
        <RequestInterceptor className="org.apache.tomcat.request.SimpleMapper" debug="0"
/>
        <RequestInterceptor className="org.apache.tomcat.request.SessionInterceptor" />
        <RequestInterceptor className="org.apache.tomcat.request.SecurityCheck" />
        <RequestInterceptor className="org.apache.tomcat.request.FixHeaders" />

        <!-- <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="80"/>
        </Connector> -->

        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="8011"/>
        </Connector>

        <!-- example - how to override AutoSetup actions -->
        <Context path="" docBase="d:/inetpub/webs/dev/dev.enform.reliantenergy.com" debug="0"
reloadable="true" > 
        </Context>
		
        <Context path="/hlp/ma" docBase="d:/inetpub/webs/dev/dev.enform.reliantenergy.com/hlp/ma"
debug="0" reloadable="true" > 
        </Context>
    </ContextManager>
</Server>


--------------------------------------------------------------------------------------------------
--- David Knaack <dknaack@rdtech.com> wrote:
> For each virtual host I have an IP address associated with the eth0
> interface (eth0:1, eth0:2, etc).  In /etc/httpd/conf/httpd.conf I have
> entries in the following format:
> 
> <VirtualHost 00.00.00.00>
>         ServerAdmin webmaster@dom.com
>         ServerName www.dom.com
>         DocumentRoot "/home/webmaster/dom.com"
> </VirtualHost>
> 
> Where 00.00.00.00 is the ip address and dom.com is the domain name.
> 
> Thanks
> DK
> 
> From: "David M. Holmes" <david_m_holmes@yahoo.com>
> > How are you doing your virtual hosts? With Apache?
> >
> > --- David Knaack <dknaack@rdtech.com> wrote:
> > > Greetings,
> > >
> > > I am attempting to make tomcat work with my virtual hosting setup.  I
> have
> > > several virtual hosts on a RH linux machine, each on a seperate IP
> address.
> > > The document root for each site is stored in "/home/webmaster/dom.com"
> where
> > > "dom.com" is the domain name.  The 'real' website uses the same
> structure.
> > >
> > > I don't want any non-tomcat related files installed in the
> > > /usr/local/jakarta-tomcat/ structure.  All JSP and java related files
> for
> > > any site should be completely contained somewhere under the document
> root
> > > directory for the domain to which they belong.
> > >
> > > All the sites are seperate and should not interact with other sites.
> > >
> > > I do not want a port number to appear anywhere in requested URLs.
> > >
> > > Do I need to run multiple instances of Tomcat?  If so, how do I launch
> and
> > > configure each instance?
> > >
> > > What configuration changes do I have to make to get tomcat to look only
> in
> > > the /home/webmaster/dom.com directory for files for the dom.com site?
> > >
> > > Thanks!
> > > DK
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Kick off your party with Yahoo! Invites.
> > http://invites.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

Mime
View raw message