You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mandar Vaidya <Ma...@quovadx.com> on 2005/05/10 17:46:21 UTC

How to change hostname in tomcat configuration

 Hi,

    I'm trying to change hostname on the tomcat server from localhost to my
server name. After I change it in server.xml, I'm able to go to
http://servername:8080  url, but I'm not able to go to
http://servername:8080/admin .  It gives me error. 

    Aprreciate any help regarding this.

Thank you
Mandar Vaidya

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


Re: How to change hostname in tomcat configuration

Posted by Lutz Zetzsche <Lu...@sea-rescue.de>.
Hi Mandar,

Mandar Vaidya schrieb:
>     I'm trying to change hostname on the tomcat server from localhost to
> my
> server name. After I change it in server.xml, I'm able to go to
> http://servername:8080  url, but I'm not able to go to
> http://servername:8080/admin .  It gives me error.
>
>     Aprreciate any help regarding this.

Instead of changing the name attribute of your Host element from
"localhost" to "servername", you can also simply nest an Alias element
into the Host element:

     <Host name="localhost" ...>
       ...
       <Alias>servername</Alias>
       ...
     </Host>

However, if you prefer to change the name attribute rather than to add an
alias, make sure to customize the defaultHost attribute of your Engine
element if you only have one Host element inside:

"The default host name, which identifies the Host that will process
requests directed to host names on this server, but which are not
configured in this configuration file. This name MUST match the name 
attributes of one of the Host elements nested immediately inside."

!


Best wishes

Lutz


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


Re: Virtual Hosts - additional info needed

Posted by Pete Stevens <pe...@ex-parrot.com>.
On Tue, 10 May 2005, Matthew P Puccio wrote:

> I'm running Tomcat 5.5.9 on a Windows2000 server. I am not running Apache
> and for various reasons won't be installing it. I'm not a Tomcat
> administrator so I may sound a bit clueless.
>
> I have tried to follow the instructions on
> http://www.ex-parrot.com/~pete/tomcat-vhost.html but am confused or don't
> understand.
>
> Here's the setup that I want:
> - I have the domain "smpdev.mwhglobal.com" that points at my Tomcat
> server's IP address.
> - My files are in /Tomcat5.5/SMP/
> - I have a Default.jsp page in /Tomcat5.5/SMP/jsp/Default.jsp. There is an
> entry in web.xml for this app for the Welcome file.
> - I have a folder /Tomcat5.5/conf/Catalina/SMP with SMP.xml. That file
> contains <Context path="" reloadable="true" docBase="SMP"> and my database
> connection info.
> - I've tried adding a new <Host> entry in server.xml, based on the info on
> the ex-parrot page (linked above):
>
> <Host name="$host" debug="0" appBase="webapps/$host"
>         unpackWARs="true" autoDeploy="true"
>     xmlValidation="false" xmlNamespaceAware="false">
>
> <Alias>$alias</Alias>
> </Host>
>
> What I don't know is what "$host" should be or "$alias" in the server.xml
> file.
> I also don't know if some of my folders should actually be called
> "smpdev.mwhglobal.com" instead of "SMP".

You can drop the <Alias>...</Alias> line in your installtion.

$host should be replaced by smpdev.mwhglobal.com

then your directory

webapps/smpdev.mwhglobal.com

should contain an unpacked copy of the site you're working with, including
your web.xml configuration file.


You need to create the configuration file in

conf/Catalina/smpdev.mwhglobal.com/ROOT.xml

<?xml version='1.0' encoding='utf-8'?>
<Context displayName="smpdev.mwhglobal.com" docBase="" path=""
workDir="work/Catalina/smpdev.mwhglobal.com/_">
</Context>


A caveat though is I haven't tested the instructions on Windows so you may
need to modify various things to make it go.

Yours,

Pete Stevens

--
Pete Stevens
pete@ex-parrot.com
http://www.ex-parrot.com/~pete/

  The last time humans crossed space to a destination was the Apollo 17 mission
  in 1972. In the 32 years since, no man has seen, with his own eyes, Earth as
 that beautiful, solitary blue sphere, and - reality check - no woman has ever
                                                                seen it at all.
                                                               -- James Cameron

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


Virtual Hosts - additional info needed

Posted by Matthew P Puccio <Ma...@us.mwhglobal.com>.
I'm running Tomcat 5.5.9 on a Windows2000 server. I am not running Apache 
and for various reasons won't be installing it. I'm not a Tomcat 
administrator so I may sound a bit clueless.

I have tried to follow the instructions on 
http://www.ex-parrot.com/~pete/tomcat-vhost.html but am confused or don't 
understand.

Here's the setup that I want:
- I have the domain "smpdev.mwhglobal.com" that points at my Tomcat 
server's IP address.
- My files are in /Tomcat5.5/SMP/
- I have a Default.jsp page in /Tomcat5.5/SMP/jsp/Default.jsp. There is an 
entry in web.xml for this app for the Welcome file.
- I have a folder /Tomcat5.5/conf/Catalina/SMP with SMP.xml. That file 
contains <Context path="" reloadable="true" docBase="SMP"> and my database 
connection info.
- I've tried adding a new <Host> entry in server.xml, based on the info on 
the ex-parrot page (linked above):
 
<Host name="$host" debug="0" appBase="webapps/$host"
        unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">

<Alias>$alias</Alias>
</Host>

What I don't know is what "$host" should be or "$alias" in the server.xml 
file.
I also don't know if some of my folders should actually be called 
"smpdev.mwhglobal.com" instead of "SMP".

If I hit http://smpdev.mwhglobal.com/SMP/jsp/Default.jsp I can access the 
application. However, I want http://smpdev.mwhglobal.com to go directly to 
this page.

BTW, this is all inside our network so you won't be able to hit the 
server.

Thanks for any help anyone can provide.


=======================
Matt Puccio
Senior Application Developer
iNet Global Solutions Delivery
MWH Global, Inc.
>>Tel: 720.887.8710
>>Fax: 720.887.8701
=======================