I am using one physical machine to host both apache and tomcat with multiple
domain names mapped to the same IP. Here is an extract of my configuration
for apache, jk2 and tomcat. The only thing I havent got working 100% is the
auto-deployment, but as its not to big a bother to manage by hand, I can
live with that for the moment.

# Apache httpd.conf
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
        ServerName domain1.my.network
</VirtualHost>

<VirtualHost 127.0.0.1>
        ServerName domain2.my.network
</VirtualHost>


#Connection Apache-Tomcat with jk2
#workers2.properties 
[uri:domain1.my.network/*]
group=ajp13:localhost:8009
[uri:domain1.my.network/*]
group=ajp13:localhost:8009


#Tomcat server.xml
<Engine name="Apache" defaultHost="local.gallriks.ucr.uu.se" debug="0">
        <Host name="domain1.my.network" appBase="webapps"/>
        <Host name="domain2.my.network" appBase="webapps"/>
</Engine>


#Context.xml for domain1
<Context        displayName="Domain1" docBase="domain1" path=""
reloadable="true">


#Context.xml for domain1
<Context        displayName="Domain2" docBase="domain2" path=""
reloadable="true">


Swanthe Lindgren
System developer
 
Uppsala Clinical Reasearch Center

-----Ursprungligt meddelande-----
Från: Mayuresh Kshirsagar [mailto:[EMAIL PROTECTED] 
Skickat: den 9 december 2004 07:56
Till: Tomcat Users List
Ämne: Re: Multiple domains on single machine

My problem is that I have two domains mapped to the same IP ? Please could
you help me in this.


----- Original Message -----
From: "Mayuresh Kshirsagar" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 11:25 AM
Subject: Re: Multiple domains on single machine


> Hi,
>
> I have to use APACHE.
>
> I have seen one example given in the APACHE documentation:
> ----------------------------------------------
>  NameVirtualHost *
>
>     <VirtualHost *>
>     ServerName www.domain.tld
>     DocumentRoot /www/domain
>     </VirtualHost>
>
>     <VirtualHost *>
>     ServerName www.otherdomain.tld
>     DocumentRoot /www/otherdomain
>     </VirtualHost>
>
> ----------------------------------------------
> So may be this isnt wrong. When I add an index.html, it is displayed by
> apache. But the JSP and servlet requests are not being passed to TOMCAT.
In
> my tomcat server.xml I have added the lines:
>
> <Host Name="support">
>     <Context path="" docBase="E:/support1.cp.net" debug="0"
> reloadable="true" />
>     </Host>
>    <Host Name="admin">
>     <Context path="" docBase="E:/admin.support.cp.net" debug="0"
> reloadable="true" />
>     </Host>
>
> The "support" one is being executed properly, but the "admin" one is not
> being recognised. any solutions ?
>
> Mayuresh.
>
>
> ----- Original Message ----- 
> From: "Benjamin Armintor" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Cc: "Mayuresh Kshirsagar" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 08, 2004 9:40 PM
> Subject: RE: Multiple domains on single machine
>
>
> You may not even need to use the Apache HTTPD web server, in which case
> you should  just have Tomcat listen on port 80 itself, and refer to the
> documentation for Hosts on the Tomcat site.
>
> If you really need to use the Apache web server, you'd probably get
> better advice from the HTTPD list for your Apache configuration.   So
> this is a bit off topic, but it's a problem that you have the one named
> VirtualHost (the default one, *:80), and two configurations for it.  You
> need to have two named VirtualHosts (one for each of your virtual hosts,
> eh?).  Read the Apache HTTPD documentation at
> http://httpd.apache.org/docs-project/.  There's very good documentation
> on most of the directives.   When you get that sorted, you'll need to
> bring Tomcat up behind Apache.  This has been worked out far better in
> numerous how-tos and messages to this list than I could here.  You'll
> find some helpful links at
> http://wiki.apache.org/jakarta-tomcat/UsefulLinks.
>
> Benjamin J. Armintor
> Operations Systems Specialist
> ITS-Systems: Mainframe Group
> University of Texas - Austin
> tele: (512) 232-6562
> email: [EMAIL PROTECTED]
>
>
>
> -----Original Message-----
> From: Mayuresh Kshirsagar [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 08, 2004 8:07 AM
> To: Tomcat Users List
> Subject: Re: Multiple domains on single machine
>
>
> Any pointers on this one please...............its urgent
>   ----- Original Message ----- 
>   From: Mayuresh Kshirsagar
>   To: [EMAIL PROTECTED]
>   Sent: Wednesday, December 08, 2004 3:27 PM
>   Subject: Multiple domains on single machine
>
>
>   Hi I have setup a test machine so that it should host two sites
>
>   1. http://admin
>   2. http://support
>
>   But only one (http://admin) is accessible and the other one is not.
> Can you give any pointers.
>
>   I set up virtual hosts as (httpd.conf):
>
>   NameVirtualHost *:80
>
>   <VirtualHost *:80>
>   ServerName admin
>   ServerAdmin [EMAIL PROTECTED]
>   DocumentRoot E:/admin.support.cp.net/html/
>   ErrorDocument 404 E:/admin.support.cp.net/notfound.html
>   ErrorLog logs/admin.support.cp.net-error_log
>   LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
>   LogFormat "%h %l %u %t \"%r\" %>s %b" common
>   LogFormat "%{Referer}i -> %U" referer
>   LogFormat "%{User-agent}i" agent
>   CustomLog logs/admin.support.cp.net-access_log combined
>   Alias /icons/ E:/admin.support.cp.net/icons/
>   ScriptAlias /cgi-bin/ E:/admin.support.cp.net/cgi-bin/
>   <Directory "E:/admin.support.cp.net/html">
>    Options FollowSymLinks Includes
>    DirectoryIndex index.html index.jsp
>    AllowOverride AuthConfig
>   </Directory>
>   AddType text/x-server-parsed-html .html
>   </VirtualHost>
>
>   <VirtualHost *:80>
>        DocumentRoot E:/support1.cp.net
>        ServerName support
>        ServerAdmin [EMAIL PROTECTED]
>        ErrorLog logs/support-error_log
>        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
> \"%{User-Agent}i\"" combined
>        LogFormat "%h %l %u %t \"%r\" %>s %b" common
>        LogFormat "%{Referer}i -> %U" referer
>        LogFormat "%{User-agent}i" agent
>        CustomLog logs/support-access_log combined
>        Alias /pdf/ E:/support1.cp.net/content/pdf/
>        Alias /images/ E:/support1.cp.net/images/
>        ScriptAlias /cgi-bin/ E:/support1.cp.net/cgi-bin/
>        ErrorDocument 404 E:/support1.cp.net/notfound.jsp
>        # Allow Server Side includes (SSI)
>        <Directory "E:/support1.cp.net">
>           Options FollowSymLinks Includes
>           AllowOverride AuthConfig
>           allow from all
>        </Directory>
>        AddType text/x-server-parsed-html .html
>   </VirtualHost>
>
>   Similarly I added following to server.xml:
>
>   <Host Name="support">
>     <Context path="" docBase="E:/support1.cp.net" debug="0"
> reloadable="true" />
>     </Host>
>    <Host Name="admin">
>     <Context path="" docBase="E:/admin.support.cp.net" debug="0"
> reloadable="true" />
>     </Host>
>
>   I also added lines to the "hosts" file on that machine:
>
>   <IP-Address> admin
>   <IP-Address> support.
>
>   Thanks Mayuresh.
>
>
> ------------------------------------------------------------------------
> ------
>
>
>   ---------------------------------------------------------------------
>   To unsubscribe, e-mail: [EMAIL PROTECTED]
>   For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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

Reply via email to