You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "M.Arkhypov" <My...@gmx.net> on 2010/10/27 16:44:18 UTC

How to start my application without localhost, only with virtiual host ?

Hi Tomcat - Users,

I use Tomcat 6.0.29 on a Suse 11.1 Linux Server and I would like to start  
my application without localhost, only with virtiual host.

On Windows it works already.
Here is the server.xml:

  <!--
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
-->

       <Host name="mmmtest.ch"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="true">
         <Alias>mmmtest.ch</Alias>
         <Context path=""
              docBase="c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples"
              reloadable="true" allowLinking="true" >
         </Context>
      </Host>

Now I can reach the network with the URL: http://mmmtest.ch/.
The tomcatmanager is reachable on: http://mmmtest.ch:8080/manager/html.


The server.xml:

  <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
     <Connector port="8080" maxHttpHeaderSize="8192"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false" redirectPort="8443" acceptCount="100"
                connectionTimeout="20000" disableUploadTimeout="true" />
     <Connector port="8010"
                enableLookups="false" redirectPort="8443"  
protocol="AJP/1.3" />

     <Engine name="Catalina" defaultHost="localhost">

       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
              resourceName="UserDatabase"/>

       <!--
       <Host name="localhost" appBase="webapps"

        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">

       </Host>
-->

      <Host name="pcd-testcommunity.de"
         unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="true">
                 <Alias>pcd-testcommunity.de</Alias>
                          <Context path=""
                                  docBase="/var/lib/tomcat55/webapps/CompetenceNetwork"
                                  reloadable="true" allowLinking="true" >
                          </Context>
      </Host>

     </Engine>

   </Service>

</Server>

The network is reachable on pcd-testcommunity.de. If I try to reach the  
tomcatmanager with http://pcd-testcommunity.de:8081/manager/html, I get an  
ERROR 404.
How can I work with tomcatmanager with these configurations?

Greetings

Michael Arkhypov, Softwareentwickler

Lyncker & Theis GmbH
Wilhelmstr. 16
65185 Wiesbaden
Germany

Fon +49 611/89038960
Fax +49 611/9406125

Handelsregister: HRB 23156 Amtsgericht Wiesbaden
Steuernummer: 04323897052
USt-IdNr.: DE255806399

Geschäftsführer:
Filip Lyncker,
Armin Theis

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


RE: How to start my application without localhost, only with virtiual host ?

Posted by marhipov <My...@gmx.net>.

We have this server.xml file: 

        <Host name="cntest2.de" appBase="webapps"
              unpackWARs="true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="true">
              <Context path=""
                       docBase="/usr/share/tomcat6/webapps/MyNetwork"
                       reloadable="true" allowLinking="true" />

        </Host>

If we have no path defined (path="") , there are two networks starting

(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context ''

and later

(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/CompetenceNetwork'

we can access the page by  http://cntest2.de/ -> and get redirected to 
http://cntest2.de/login.html. 

If we define the path like path="/MyNetwork".  

        <Host name="cntest2.de" appBase="webapps"
              unpackWARs="true" autoDeploy="true"
              xmlValidation="false" xmlNamespaceAware="true">
              <Context path="/MyNetwork"
                       docBase="/usr/share/tomcat6/webapps/MyNetwork"
                       reloadable="true" allowLinking="true" />
        </Host>

And starts only one network:
(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/CompetenceNetwork'

The page http://cntest2.de/MyNetwork/login.html works fine.

But if we go to the page http://cntest2.de/ the index.html from ROOT is
showing.

So now we did what you said and copied the MyNetwork content (subfolder and
files) to the ROOT directory. Then we see the loginpage
of MyNetwork as expected. But now if we try to login we get URL-"redirected"
to: http://cntest2.de/pages/#{subUserSessionUtil.startPageAddress}
There is no error shown in the catalina.out, but the
#{subUserSessionUtil.startPageAddress} looks like an uninterpreted handler
call. That works if we access
the network with http://cntest2.de:8080/MyNetwork/login.html. The goal is to
access the network by its configured URL-pattern ->
http://cntest2.de/login.html
(and do login etc.)

The question: how can we adjust the server.xml and work with url 
http://cntest2.de/login.html , not with
http://cntest2.de/MyNetwork/login.html ? 

Tnank you

////////////////////////////

from apache2:

vhost_cn.conf  

  # Update this path to match your conf directory location (put
workers.properties next to httpd.
  # JkWorkersFile /etc/tomcat6/workers.properties
  # Where to put jk shared memory
  # Update this path to match your local state directory or logs directory
  JkShmFile     /var/log/apache2/mod_jk.shm
  # Where to put jk logs
  #mmm:
  JkWorkersFile   /usr/share/tomcat6/conf/worker.properties
  #
  # Update this path to match your logs directory location (put mod_jk.log
next to access_log)
  JkLogFile     /var/log/apache2/mod_jk.log
  # Set the jk log level [debug/error/info]
  JkLogLevel   info
  # Select the timestamp log format
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

NameVirtualHost *

<VirtualHost *>
 DocumentRoot /usr/share/tomcat6/webapps/MyNetwork
.
 JkMount /* worker1
..
  # Serve html, jpg and gif using httpd
  JkUnMount /*.html ajp13
  JkUnMount /*.jpg  ajp13
  JkUnMount /*.gif  ajp13
 ServerName cntest2.de
 ServerAdmin info@cntest2.de
 <Directory "/usr/share/tomcat6/webapps/MyNetwork">
  Options Indexes MultiViews
  AllowOverride none
  Allow from all
 </Directory>
<Location "/WEB-INF/">
   #AllowOverride None
   deny from all
</Location>

#RewriteEngine On
Options +FollowSymLinks

/////////////////////////////////






n828cl wrote:
> 
>> From: M.Arkhypov [mailto:Mykhaylo.Arkhypov@gmx.net] 
>> Subject: How to start my application without localhost, only with
>> virtiual host ?
> 
>> I would like to start my application without localhost,
>> only with virtiual host.
> 
> All <Host> elements are virtual.  The name "localhost" in the <Engine> and
> one <Host> element has nothing to do with 127.0.0.1, but rather it simply
> links the <Engine> to the default <Host>.  You must always have one
> default <Host>, but it can be any of your <Host> elements.
> 
>> <Host name="mmmtest.ch"
>>       unpackWARs="true" autoDeploy="true"
>>       xmlValidation="false" xmlNamespaceAware="true">
>>   <Alias>mmmtest.ch</Alias>
> 
> You're missing the appBase attribute; the value for that should be unique
> for each <Host>.
> 
> That's a pointless <Alias>, since it's the same as the name attribute.
> 
>>   <Context path=""
>>            docBase="c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples"
>>            reloadable="true" allowLinking="true" >
>>   </Context>
> 
> It's extremely bad practice to put <Context> elements in server.xml, and
> very dangerous to share webapps across multiple <Host> elements.
> 
>> The tomcatmanager is reachable on: 
>> http://mmmtest.ch:8080/manager/html.
> 
> Only because both <Host> elements are sharing appBase - a really bad idea.
> 
>> <Host name="pcd-testcommunity.de"
>>       unpackWARs="true" autoDeploy="true"
>>       xmlValidation="false" xmlNamespaceAware="true">
>>   <Alias>pcd-testcommunity.de</Alias>
> 
> Another useless <Alias>.
> 
>> <Context path=""
>>          docBase="/var/lib/tomcat55/webapps/CompetenceNetwork"
>>          reloadable="true" allowLinking="true" >
>> </Context>
> 
> Another undesirable location for a <Context> element.  The webapp should
> be renamed to ROOT, and the <Context> element placed in
> /var/lib/tomcat55/webapps/ROOT/META-INF/context.xml, and the path
> attribute removed.
> 
>> How can I work with tomcatmanager with these configurations?
> 
> You must place a copy of the manager webapp in each <Host>'s appBase
> directory.
> 
>  - 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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-start-my-application-without-localhost%2C-only-with-virtiual-host---tp30068006p30087000.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: How to start my application without localhost, only with virtiual host ?

Posted by Pid <pi...@pidster.com>.
On 29/10/2010 17:15, M.Arkhypov wrote:
> 
> Dear Chuck,
> 
> thank you for your attention and reply,
> 
> we have done a few of yours advices, but without success:
> 
> 
> We have this server.xml file:
> 
>         <Host name="cntest2.de" appBase="webapps"
>               unpackWARs="true" autoDeploy="true"
>               xmlValidation="false" xmlNamespaceAware="true">
>               <Context path=""
>                        docBase="/usr/share/tomcat6/webapps/MyNetwork"
>                        reloadable="true" allowLinking="true" />
> 
>         </Host>
> 
> If we have no path defined (path="") , there are two networks starting

Tomcat will deploy an application (either a 'app.war' file or 'app'
directory) if it finds it in the Host's configured appBase directory.

The 'appBase' is not the same an Apache HTTPD DocumentRoot directory.


> (catalina.out - part)
> INFO: Initializing Mojarra (1.2_12-b01-FCS) for context ''
> 
> and later
> 
> (catalina.out - part)
> INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/MyNetwork'

Probably because Tomcat is deploying one instance as the ROOT
application, because you have configured the Context definition and once
for the MyNetwork directory it finds in the appBase.

> we can access the page by  http://cntest2.de/ -> and get redirected to
> http://cntest2.de/login.html.
> 
> If we define the path like path="/MyNetwork".
> 
>         <Host name="cntest2.de" appBase="webapps"
>               unpackWARs="true" autoDeploy="true"
>               xmlValidation="false" xmlNamespaceAware="true">
>               <Context path="/MyNetwork"
>                        docBase="/usr/share/tomcat6/webapps/MyNetwork"
>                        reloadable="true" allowLinking="true" />
>         </Host>
> 
> And starts only one network:

As Chuck tried to tell you.  Do NOT define the Context in server.xml.
Please just completely remove all Context definitions from server.xml.


> (catalina.out - part)
> INFO: Initializing Mojarra (1.2_12-b01-FCS) for context
> '/CompetenceNetwork'
> 
> The page http://cntest2.de/MyNetwork/login.html works fine.
> 
> But if we go to the page http://cntest2.de/ the index.html from ROOT is
> showing.
> 
> So now we did what you said and copied the MyNetwork content (subfolder
> and files) to the ROOT directory. Then we see the loginpage of MyNetwork
> as expected. But now if we try to login we get URL-"redirected" to:

The ROOT directory is actually an application, you may have corrupted
the application by just copying over the content.  It would be better to
have renamed your MyNetwork directory to become the ROOT directory.


> http://cntest2.de/pages/#{subUserSessionUtil.startPageAddress}

(See below)

> There is no error shown in the catalina.out, but the
> #{subUserSessionUtil.startPageAddress} looks like an uninterpreted
> handler call. That works if we access
> the network with http://cntest2.de:8080/MyNetwork/login.html. The goal
> is to access the network by its configured URL-pattern ->
> http://cntest2.de/login.html
> (and do login etc.)
> 
> The question: how can we adjust the server.xml and work with url 
> http://cntest2.de/login.html , not with
> http://cntest2.de/MyNetwork/login.html ?

As above.  Completely remove the Context definition from server.xml.

> Tnank you
> 
> ////////////////////////////
> 
> conf. from apache2:
> 
> vhost_cn.conf
> 
>   # Update this path to match your conf directory location (put
> workers.properties next to httpd.
>   # JkWorkersFile /etc/tomcat6/workers.properties
>   # Where to put jk shared memory
>   # Update this path to match your local state directory or logs directory
>   JkShmFile     /var/log/apache2/mod_jk.shm
>   # Where to put jk logs
>   #mmm:
>   JkWorkersFile   /usr/share/tomcat6/conf/worker.properties
>   #
>   # Update this path to match your logs directory location (put
> mod_jk.log next to access_log)
>   JkLogFile     /var/log/apache2/mod_jk.log
>   # Set the jk log level [debug/error/info]
>   JkLogLevel   info
>   # Select the timestamp log format
>   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> 
> NameVirtualHost *
> 
> <VirtualHost *>
>  DocumentRoot /usr/share/tomcat6/webapps/MyNetwork

*Never* map an HTTPD DocumentRoot to the same directory as a Tomcat.

It is a security risk and it will almost certainly result in your
application serving files that are not properly processed by Tomcat.


>  JkMount /* worker1
> ..
>   # Serve html, jpg and gif using httpd
>   JkUnMount /*.html ajp13
>   JkUnMount /*.jpg  ajp13
>   JkUnMount /*.gif  ajp13

Why use HTTPD to serve these files?  Tomcat can do the job perfectly well.

If you must use HTTPD with Tomcat, arrange the directory structures so
that the two servers do not serve files from the same directory, like this:

 /sites/www.foo.com/static
 /sites/www.foo.com/static/images
 /sites/www.foo.com/webapps/
 /sites/www.foo.com/webapps/ROOT
 /sites/www.foo.com/webapps/MyApplication

In httpd.conf

 DocumentRoot /sites/www.foo.com/static

In server.xml:

 <Host name="www.foo.com" appBase="/sites/www.foo.com/webapps" ... >


p

>  ServerName cntest2.de
>  ServerAdmin info@cntest2.de
>  <Directory "/usr/share/tomcat6/webapps/MyNetwork">
>   Options Indexes MultiViews
>   AllowOverride none
>   Allow from all
>  </Directory>
> <Location "/WEB-INF/">
>    #AllowOverride None
>    deny from all
> </Location>
> 
> #RewriteEngine On
> Options +FollowSymLinks
> 
> /////////////////////////////////
> 
> Am 27.10.2010, 17:44 Uhr, schrieb Caldarale, Charles R
> <Ch...@unisys.com>:
> 
>>> From: M.Arkhypov [mailto:Mykhaylo.Arkhypov@gmx.net]
>>> Subject: How to start my application without localhost, only with
>>> virtiual host ?
>>
>>> I would like to start my application without localhost,
>>> only with virtiual host.
>>
>> All <Host> elements are virtual.  The name "localhost" in the <Engine>
>> and one <Host> element has nothing to do with 127.0.0.1, but rather it
>> simply links the <Engine> to the default <Host>.  You must always have
>> one default <Host>, but it can be any of your <Host> elements.
>>
>>> <Host name="mmmtest.ch"
>>>       unpackWARs="true" autoDeploy="true"
>>>       xmlValidation="false" xmlNamespaceAware="true">
>>>   <Alias>mmmtest.ch</Alias>
>>
>> You're missing the appBase attribute; the value for that should be
>> unique for each <Host>.
>>
>> That's a pointless <Alias>, since it's the same as the name attribute.
>>
>>>   <Context path=""
>>>            docBase="c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples"
>>>            reloadable="true" allowLinking="true" >
>>>   </Context>
>>
>> It's extremely bad practice to put <Context> elements in server.xml,
>> and very dangerous to share webapps across multiple <Host> elements.
>>
>>> The tomcatmanager is reachable on:
>>> http://mmmtest.ch:8080/manager/html.
>>
>> Only because both <Host> elements are sharing appBase - a really bad
>> idea.
>>
>>> <Host name="pcd-testcommunity.de"
>>>       unpackWARs="true" autoDeploy="true"
>>>       xmlValidation="false" xmlNamespaceAware="true">
>>>   <Alias>pcd-testcommunity.de</Alias>
>>
>> Another useless <Alias>.
>>
>>> <Context path=""
>>>          docBase="/var/lib/tomcat55/webapps/CompetenceNetwork"
>>>          reloadable="true" allowLinking="true" >
>>> </Context>
>>
>> Another undesirable location for a <Context> element.  The webapp
>> should be renamed to ROOT, and the <Context> element placed in
>> /var/lib/tomcat55/webapps/ROOT/META-INF/context.xml, and the path
>> attribute removed.
>>
>>> How can I work with tomcatmanager with these configurations?
>>
>> You must place a copy of the manager webapp in each <Host>'s appBase
>> directory.
>>
>>  - 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: How to start my application without localhost, only with virtiual host ?

Posted by "M.Arkhypov" <My...@gmx.net>.
Dear Chuck,

thank you for your attention and reply,

we have done a few of yours advices, but without success:


We have this server.xml file:

         <Host name="cntest2.de" appBase="webapps"
               unpackWARs="true" autoDeploy="true"
               xmlValidation="false" xmlNamespaceAware="true">
               <Context path=""
                        docBase="/usr/share/tomcat6/webapps/MyNetwork"
                        reloadable="true" allowLinking="true" />

         </Host>

If we have no path defined (path="") , there are two networks starting

(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context ''

and later

(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context '/MyNetwork'

we can access the page by  http://cntest2.de/ -> and get redirected to
http://cntest2.de/login.html.

If we define the path like path="/MyNetwork".

         <Host name="cntest2.de" appBase="webapps"
               unpackWARs="true" autoDeploy="true"
               xmlValidation="false" xmlNamespaceAware="true">
               <Context path="/MyNetwork"
                        docBase="/usr/share/tomcat6/webapps/MyNetwork"
                        reloadable="true" allowLinking="true" />
         </Host>

And starts only one network:

(catalina.out - part)
INFO: Initializing Mojarra (1.2_12-b01-FCS) for context  
'/CompetenceNetwork'

The page http://cntest2.de/MyNetwork/login.html works fine.

But if we go to the page http://cntest2.de/ the index.html from ROOT is  
showing.

So now we did what you said and copied the MyNetwork content (subfolder  
and files) to the ROOT directory. Then we see the loginpage of MyNetwork  
as expected. But now if we try to login we get URL-"redirected" to:

http://cntest2.de/pages/#{subUserSessionUtil.startPageAddress}

There is no error shown in the catalina.out, but the  
#{subUserSessionUtil.startPageAddress} looks like an uninterpreted handler  
call. That works if we access
the network with http://cntest2.de:8080/MyNetwork/login.html. The goal is  
to access the network by its configured URL-pattern ->  
http://cntest2.de/login.html
(and do login etc.)

The question: how can we adjust the server.xml and work with url   
http://cntest2.de/login.html , not with  
http://cntest2.de/MyNetwork/login.html ?

Tnank you

////////////////////////////

conf. from apache2:

vhost_cn.conf

   # Update this path to match your conf directory location (put  
workers.properties next to httpd.
   # JkWorkersFile /etc/tomcat6/workers.properties
   # Where to put jk shared memory
   # Update this path to match your local state directory or logs directory
   JkShmFile     /var/log/apache2/mod_jk.shm
   # Where to put jk logs
   #mmm:
   JkWorkersFile   /usr/share/tomcat6/conf/worker.properties
   #
   # Update this path to match your logs directory location (put mod_jk.log  
next to access_log)
   JkLogFile     /var/log/apache2/mod_jk.log
   # Set the jk log level [debug/error/info]
   JkLogLevel   info
   # Select the timestamp log format
   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

NameVirtualHost *

<VirtualHost *>
  DocumentRoot /usr/share/tomcat6/webapps/MyNetwork
.
  JkMount /* worker1
..
   # Serve html, jpg and gif using httpd
   JkUnMount /*.html ajp13
   JkUnMount /*.jpg  ajp13
   JkUnMount /*.gif  ajp13
  ServerName cntest2.de
  ServerAdmin info@cntest2.de
  <Directory "/usr/share/tomcat6/webapps/MyNetwork">
   Options Indexes MultiViews
   AllowOverride none
   Allow from all
  </Directory>
<Location "/WEB-INF/">
    #AllowOverride None
    deny from all
</Location>

#RewriteEngine On
Options +FollowSymLinks

/////////////////////////////////

Am 27.10.2010, 17:44 Uhr, schrieb Caldarale, Charles R  
<Ch...@unisys.com>:

>> From: M.Arkhypov [mailto:Mykhaylo.Arkhypov@gmx.net]
>> Subject: How to start my application without localhost, only with  
>> virtiual host ?
>
>> I would like to start my application without localhost,
>> only with virtiual host.
>
> All <Host> elements are virtual.  The name "localhost" in the <Engine>  
> and one <Host> element has nothing to do with 127.0.0.1, but rather it  
> simply links the <Engine> to the default <Host>.  You must always have  
> one default <Host>, but it can be any of your <Host> elements.
>
>> <Host name="mmmtest.ch"
>>       unpackWARs="true" autoDeploy="true"
>>       xmlValidation="false" xmlNamespaceAware="true">
>>   <Alias>mmmtest.ch</Alias>
>
> You're missing the appBase attribute; the value for that should be  
> unique for each <Host>.
>
> That's a pointless <Alias>, since it's the same as the name attribute.
>
>>   <Context path=""
>>            docBase="c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples"
>>            reloadable="true" allowLinking="true" >
>>   </Context>
>
> It's extremely bad practice to put <Context> elements in server.xml, and  
> very dangerous to share webapps across multiple <Host> elements.
>
>> The tomcatmanager is reachable on:
>> http://mmmtest.ch:8080/manager/html.
>
> Only because both <Host> elements are sharing appBase - a really bad  
> idea.
>
>> <Host name="pcd-testcommunity.de"
>>       unpackWARs="true" autoDeploy="true"
>>       xmlValidation="false" xmlNamespaceAware="true">
>>   <Alias>pcd-testcommunity.de</Alias>
>
> Another useless <Alias>.
>
>> <Context path=""
>>          docBase="/var/lib/tomcat55/webapps/CompetenceNetwork"
>>          reloadable="true" allowLinking="true" >
>> </Context>
>
> Another undesirable location for a <Context> element.  The webapp should  
> be renamed to ROOT, and the <Context> element placed in  
> /var/lib/tomcat55/webapps/ROOT/META-INF/context.xml, and the path  
> attribute removed.
>
>> How can I work with tomcatmanager with these configurations?
>
> You must place a copy of the manager webapp in each <Host>'s appBase  
> directory.
>
>  - 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
>


-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

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


RE: How to start my application without localhost, only with virtiual host ?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: M.Arkhypov [mailto:Mykhaylo.Arkhypov@gmx.net] 
> Subject: How to start my application without localhost, only with virtiual host ?

> I would like to start my application without localhost,
> only with virtiual host.

All <Host> elements are virtual.  The name "localhost" in the <Engine> and one <Host> element has nothing to do with 127.0.0.1, but rather it simply links the <Engine> to the default <Host>.  You must always have one default <Host>, but it can be any of your <Host> elements.

> <Host name="mmmtest.ch"
>       unpackWARs="true" autoDeploy="true"
>       xmlValidation="false" xmlNamespaceAware="true">
>   <Alias>mmmtest.ch</Alias>

You're missing the appBase attribute; the value for that should be unique for each <Host>.

That's a pointless <Alias>, since it's the same as the name attribute.

>   <Context path=""
>            docBase="c:/temp_mmm/apache-tomcat-6.0.29/webapps/examples"
>            reloadable="true" allowLinking="true" >
>   </Context>

It's extremely bad practice to put <Context> elements in server.xml, and very dangerous to share webapps across multiple <Host> elements.

> The tomcatmanager is reachable on: 
> http://mmmtest.ch:8080/manager/html.

Only because both <Host> elements are sharing appBase - a really bad idea.

> <Host name="pcd-testcommunity.de"
>       unpackWARs="true" autoDeploy="true"
>       xmlValidation="false" xmlNamespaceAware="true">
>   <Alias>pcd-testcommunity.de</Alias>

Another useless <Alias>.

> <Context path=""
>          docBase="/var/lib/tomcat55/webapps/CompetenceNetwork"
>          reloadable="true" allowLinking="true" >
> </Context>

Another undesirable location for a <Context> element.  The webapp should be renamed to ROOT, and the <Context> element placed in /var/lib/tomcat55/webapps/ROOT/META-INF/context.xml, and the path attribute removed.

> How can I work with tomcatmanager with these configurations?

You must place a copy of the manager webapp in each <Host>'s appBase directory.

 - 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