You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexander Diedler <ad...@tecracer.de> on 2009/05/07 14:56:24 UTC

Multiple Context and Websites

Hello,

Something stupid to me, but it will not works. I want to have several
webapps managed by Manager.

Tomcat1.de and tomcat2.de point to the same Tomcat 6.0.18 server (edit
Windows hosts-File).

In the /conf/Catalina/localhost/ there are tomcat1.xml  with this code:

<?xml version='1.0' encoding='utf-8'?>

<Context path="/tomcat1" reloadable="true"
docBase="C:\Inetpub\tomcat\Webseite1" distributable="true"></Context>

 

and tomcat2.xml :

<?xml version='1.0' encoding='utf-8'?>

<Context path="/tomcat2" reloadable="true"
docBase="C:\Inetpub\tomcat\Webseite2" distributable="true"></Context>

 

In the server.xml I add this lines:

<Host name="tomcat1.de"

                               appBase="/tomcat1" unpackWARs="true"

                               autoDeploy="true" xmlValidation="false"

                               xmlNamespaceAware="false">

                <Valve

 
className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs"

                prefix="tomcat1_access_log." suffix=".txt"

                pattern="combined" resolveHosts="false"/>

      </Host>

 

But a http://tomcat1.de:8080/  results a 400 Error but a
http://localhost:8080/tomcat1/  show me the content of the Application.

What´s wrong?  

I target is to have multiple Applications, that can be restarted with Tomcat
Manager and will be opened by the URL http://tomcat1.de/  (without the
/tomcat1 Prefix)

 

 

Greetings

Alexander

 


RE: Multiple Context and Websites

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alexander Diedler [mailto:adiedler@tecracer.de]
> Subject: AW: Multiple Context and Websites

> Yes, that it is what we want, to have one domain for one webapps.

Then you will need multiple <Host> elements, each with a unique appBase setting.  Deploy the default webapp as ROOT under each appBase.

> But also we want to have the possibility to start every webapp 
> himself with the Tomcat Manager without to restart the other 
> contexts (webapps).

Install the manager webapp under each appBase.

 - Chuck

 
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

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


AW: Multiple Context and Websites

Posted by Alexander Diedler <ad...@tecracer.de>.
-----Ursprüngliche Nachricht-----
Von: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Gesendet: Donnerstag, 7. Mai 2009 15:54
An: Tomcat Users List
Betreff: RE: Multiple Context and Websites

> From: Alexander Diedler [mailto:adiedler@tecracer.de]
> Subject: AW: Multiple Context and Websites
> 
> AD : But we want to use different Hostnames, it cannot be placed in the
> localhost?

Just using different host names is a DNS issue; it does not require multiple
<Host> elements in Tomcat.  You only need multiple <Host>s if you want
separate sets of webapps for each domain.

> AD: Some Websites (Applications) should be hosted on this Tomcat e.g.
> applicationA.domain.de, applicationB.domain.de and every Website has it
> own directory on HDD. But it is not inside the Tomcat Folders.

You still seem to be confusing webapps with domains.  You can have multiple
webapps for one domain, a single default webapp for each domain, or multiple
webapps for each domain; all combinations are possible.  What do you want?

Can you provide a set of example URLs and the webapps you expect those URLs
to reference?  If you want a single default webapp for each domain, you'll
need one <Host> element for each, with a separate appBase setting for each.
Inside each appBase directory should be a ROOT subdirectory (or ROOT.war
file) containing the webapp for that domain.  The <Context> element for each
should be in ROOT/META-INF/context.xml.

You will also need to deploy a separate copy of the manager app for each
<Host>.

Yes, that it is what we want, to have one domain for one webapps. But also
we want to have the possibility to start every webapp himself with the
Tomcat Manager without to restart the other contexts (webapps). It is now
more clearly?

You definitely should read the link Hassan provided.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


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


RE: Multiple Context and Websites

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alexander Diedler [mailto:adiedler@tecracer.de]
> Subject: AW: Multiple Context and Websites
> 
> AD : But we want to use different Hostnames, it cannot be placed in the
> localhost?

Just using different host names is a DNS issue; it does not require multiple <Host> elements in Tomcat.  You only need multiple <Host>s if you want separate sets of webapps for each domain.

> AD: Some Websites (Applications) should be hosted on this Tomcat e.g.
> applicationA.domain.de, applicationB.domain.de and every Website has it
> own directory on HDD. But it is not inside the Tomcat Folders.

You still seem to be confusing webapps with domains.  You can have multiple webapps for one domain, a single default webapp for each domain, or multiple webapps for each domain; all combinations are possible.  What do you want?

Can you provide a set of example URLs and the webapps you expect those URLs to reference?  If you want a single default webapp for each domain, you'll need one <Host> element for each, with a separate appBase setting for each.  Inside each appBase directory should be a ROOT subdirectory (or ROOT.war file) containing the webapp for that domain.  The <Context> element for each should be in ROOT/META-INF/context.xml.

You will also need to deploy a separate copy of the manager app for each <Host>.

You definitely should read the link Hassan provided.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


AW: Multiple Context and Websites

Posted by Alexander Diedler <ad...@tecracer.de>.

-----Ursprüngliche Nachricht-----
Von: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Gesendet: Donnerstag, 7. Mai 2009 15:20
An: Tomcat Users List
Betreff: RE: Multiple Context and Websites

> From: Alexander Diedler [mailto:adiedler@tecracer.de]
> Subject: Multiple Context and Websites
> 
> In the /conf/Catalina/localhost/ there are tomcat1.xml  with this code:
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="/tomcat1" reloadable="true"
> docBase="C:\Inetpub\tomcat\Webseite1" distributable="true"></Context>

Take out the path attribute; it's not allowed.
AD : Done

> and tomcat2.xml :
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="/tomcat2" reloadable="true"
> docBase="C:\Inetpub\tomcat\Webseite2" distributable="true"></Context>

Take out the path attribute, it's not allowed.
AD : Done


> In the server.xml I add this lines:
> <Host name="tomcat1.de"

You may not need a second <Host>, depending on what you're really trying to achieve (which is not at all clear).
AD : But we want to use different Hostnames, it cannot be placed in the localhost?

> But a http://tomcat1.de:8080/  results a 400 Error

Which it should - you have no default application for that <Host>.

> http://localhost:8080/tomcat1/  show me the content of the Application.

As it should, given your configuration.

> What´s wrong?

Nothing so far.

> I target is to have multiple Applications, that can be restarted with
> Tomcat Manager and will be opened by the URL http://tomcat1.de/
> (without the /tomcat1 Prefix)

How do you expect to have multiple webapps opened by a single URL (that's what the above statement says)?  What are you really trying to achieve?  Do you want multiple hosts, each with a default webapp, or do you want multiple webapps for a single host?
 
AD: Some Websites (Applications) should be hosted on this Tomcat e.g. applicationA.domain.de, applicationB.domain.de and every Website has it own directory on HDD. But it is not inside the Tomcat Folders.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Multiple Context and Websites

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alexander Diedler [mailto:adiedler@tecracer.de]
> Subject: Multiple Context and Websites
> 
> In the /conf/Catalina/localhost/ there are tomcat1.xml  with this code:
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="/tomcat1" reloadable="true"
> docBase="C:\Inetpub\tomcat\Webseite1" distributable="true"></Context>

Take out the path attribute; it's not allowed.

> and tomcat2.xml :
> <?xml version='1.0' encoding='utf-8'?>
> <Context path="/tomcat2" reloadable="true"
> docBase="C:\Inetpub\tomcat\Webseite2" distributable="true"></Context>

Take out the path attribute, it's not allowed.

> In the server.xml I add this lines:
> <Host name="tomcat1.de"

You may not need a second <Host>, depending on what you're really trying to achieve (which is not at all clear).

> But a http://tomcat1.de:8080/  results a 400 Error

Which it should - you have no default application for that <Host>.

> http://localhost:8080/tomcat1/  show me the content of the Application.

As it should, given your configuration.

> What´s wrong?

Nothing so far.

> I target is to have multiple Applications, that can be restarted with
> Tomcat Manager and will be opened by the URL http://tomcat1.de/
> (without the /tomcat1 Prefix)

How do you expect to have multiple webapps opened by a single URL (that's what the above statement says)?  What are you really trying to achieve?  Do you want multiple hosts, each with a default webapp, or do you want multiple webapps for a single host?
 
 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Multiple Context and Websites

Posted by Hassan Schroeder <ha...@gmail.com>.
On Thu, May 7, 2009 at 5:56 AM, Alexander Diedler <ad...@tecracer.de> wrote:

> Tomcat1.de and tomcat2.de point to the same Tomcat 6.0.18 server (edit
> Windows hosts-File).

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

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


RE: Multiple Context and Websites

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Subject: RE: Multiple Context and Websites
> 
> Inetpub is the default folder for IIS
> try re-installing tomcat to a new folder and point the docBase to be
> based off of catalina.home (which is your new Tomcat folder)
> 
> <Context docBase="${catalina.home}/webapps/YourWebAppNameGoesHere"
>          privileged="true" antiResourceLocking="false"
> antiJARLocking="false">
> </Context>

Ignore all of the above - it's completely irrelevant to the issue being discussed.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Multiple Context and Websites

Posted by Martin Gainty <mg...@hotmail.com>.
Inetpub is the default folder for IIS
try re-installing tomcat to a new folder and point the docBase to be based off of catalina.home (which is your new Tomcat folder)

<Context docBase="${catalina.home}/webapps/YourWebAppNameGoesHere"
         privileged="true" antiResourceLocking="false" antiJARLocking="false">
</Context>

Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




From: adiedler@tecracer.de
To: users@tomcat.apache.org
Date: Thu, 7 May 2009 14:56:24 +0200
Subject: Multiple Context and Websites
















Hello,

Something stupid to me, but it will not
works. I want to have several webapps managed by Manager.

Tomcat1.de and tomcat2.de point to the same
Tomcat 6.0.18 server (edit Windows hosts-File).

In the /conf/Catalina/localhost/ there are
tomcat1.xml  with this code:

<?xml version='1.0'
encoding='utf-8'?>

<Context path="/tomcat1"
reloadable="true" docBase="C:\Inetpub\tomcat\Webseite1"
distributable="true"></Context>

 

and tomcat2.xml :

<?xml version='1.0'
encoding='utf-8'?>

<Context path="/tomcat2"
reloadable="true" docBase="C:\Inetpub\tomcat\Webseite2"
distributable="true"></Context>

 

In the server.xml I add this lines:

<Host name="tomcat1.de"

                               appBase="/tomcat1"
unpackWARs="true"

                               autoDeploy="true"
xmlValidation="false"

                               xmlNamespaceAware="false">

                <Valve

                className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs"

                prefix="tomcat1_access_log."
suffix=".txt"

                pattern="combined"
resolveHosts="false"/>

      </Host>

 

But a http://tomcat1.de:8080/ 
results a 400 Error but a http://localhost:8080/tomcat1/ 
show me the content of the Application.

What´s wrong?  

I target is to have multiple Applications,
that can be restarted with Tomcat Manager and will be opened by the URL http://tomcat1.de/  (without the /tomcat1 Prefix)

 

 

Greetings

Alexander

 


_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009