You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Samsamoddin Rajaei <sa...@rajaei.de> on 2006/09/21 16:36:04 UTC
How to test a tomcat virtual host?
Hi everybody,
(I am newbie in this list!)
I am trying to test my virtual hosts and my tomcat configuration on my
local pc (Windows XP). I am using tomcat 5.0.28 and have configured
following virtual hosts in my server.xml:
<Service name="Test">
<Connector port="9080" />
<Connector port="9009" protocol="AJP/1.3" />
<Engine name="TestEngine" defaultHost="host1" debug="0">
<Host name="host1" debug="0" appBase="e:/tmp/hosts/host1">
<Context path="" reloadable="true" docBase="/web"/>
</Host>
<Host name="host2" debug="0" appBase="e:/tmp/hosts/host2">
<Context path="" reloadable="true" docBase="/web"/>
</Host>
<Host name="host3" debug="0" appBase="e:/tmp/hosts/host3">
<Context path="" reloadable="true" docBase="/web"/>
</Host>
</Engine>
</Service>
When I start tomcat they are no exceptions and everything seems to be ok.
When I call the page "http://127.0.0.1:9080/" I see the defaultHost
(host1). My Question is: how can I test my other hosts (host2 and host3)
without declaring them as defarultHost? "http://127.0.0.1:9080/host2"
doesn't work!
Thanks for any help,
Sam
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: How to test a tomcat virtual host?
Posted by Hassan Schroeder <ha...@gmail.com>.
On 9/21/06, Samsamoddin Rajaei <sa...@rajaei.de> wrote:
> I am trying to test my virtual hosts and my tomcat configuration on my
> local pc (Windows XP).
> When I start tomcat they are no exceptions and everything seems to be ok.
> When I call the page "http://127.0.0.1:9080/" I see the defaultHost
> (host1). My Question is: how can I test my other hosts (host2 and host3)
Add them to your hosts file -- on Windows it's something similar to
C: \WINNT\System32\drivers\etc\hosts
HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: How to test a tomcat virtual host?
Posted by Samsamoddin Rajaei <sa...@rajaei.de>.
Thank you,
it should be the answer. I must only find which service or program uses
the file "hosts", because I can not modify it (it is not read only)!
Sam
> If you are using windows you could try added a line like the following
> to the c:\WINDOWS\system32\drivers\etc\hosts file.
>
> 127.0.0.1 www.virtualhost1.com
>
> Then open www.virtualhost1.com in your web browser. the same this
> should be possible from linux but i dont have my linux hat on at the
> moment.
>
> Ben
>
> On 9/21/06, Samsamoddin Rajaei <sa...@rajaei.de> wrote:
>> Hi everybody,
>> (I am newbie in this list!)
>>
>> I am trying to test my virtual hosts and my tomcat configuration on my
>> local pc (Windows XP). I am using tomcat 5.0.28 and have configured
>> following virtual hosts in my server.xml:
>>
>> <Service name="Test">
>> <Connector port="9080" />
>> <Connector port="9009" protocol="AJP/1.3" />
>>
>> <Engine name="TestEngine" defaultHost="host1" debug="0">
>> <Host name="host1" debug="0" appBase="e:/tmp/hosts/host1">
>> <Context path="" reloadable="true" docBase="/web"/>
>> </Host>
>> <Host name="host2" debug="0" appBase="e:/tmp/hosts/host2">
>> <Context path="" reloadable="true" docBase="/web"/>
>> </Host>
>> <Host name="host3" debug="0" appBase="e:/tmp/hosts/host3">
>> <Context path="" reloadable="true" docBase="/web"/>
>> </Host>
>> </Engine>
>> </Service>
>>
>> When I start tomcat they are no exceptions and everything seems to be
>> ok.
>> When I call the page "http://127.0.0.1:9080/" I see the defaultHost
>> (host1). My Question is: how can I test my other hosts (host2 and host3)
>> without declaring them as defarultHost? "http://127.0.0.1:9080/host2"
>> doesn't work!
>>
>> Thanks for any help,
>> Sam
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: How to test a tomcat virtual host?
Posted by ben short <be...@benshort.co.uk>.
If you are using windows you could try added a line like the following
to the c:\WINDOWS\system32\drivers\etc\hosts file.
127.0.0.1 www.virtualhost1.com
Then open www.virtualhost1.com in your web browser. the same this
should be possible from linux but i dont have my linux hat on at the
moment.
Ben
On 9/21/06, Samsamoddin Rajaei <sa...@rajaei.de> wrote:
> Hi everybody,
> (I am newbie in this list!)
>
> I am trying to test my virtual hosts and my tomcat configuration on my
> local pc (Windows XP). I am using tomcat 5.0.28 and have configured
> following virtual hosts in my server.xml:
>
> <Service name="Test">
> <Connector port="9080" />
> <Connector port="9009" protocol="AJP/1.3" />
>
> <Engine name="TestEngine" defaultHost="host1" debug="0">
> <Host name="host1" debug="0" appBase="e:/tmp/hosts/host1">
> <Context path="" reloadable="true" docBase="/web"/>
> </Host>
> <Host name="host2" debug="0" appBase="e:/tmp/hosts/host2">
> <Context path="" reloadable="true" docBase="/web"/>
> </Host>
> <Host name="host3" debug="0" appBase="e:/tmp/hosts/host3">
> <Context path="" reloadable="true" docBase="/web"/>
> </Host>
> </Engine>
> </Service>
>
> When I start tomcat they are no exceptions and everything seems to be ok.
> When I call the page "http://127.0.0.1:9080/" I see the defaultHost
> (host1). My Question is: how can I test my other hosts (host2 and host3)
> without declaring them as defarultHost? "http://127.0.0.1:9080/host2"
> doesn't work!
>
> Thanks for any help,
> Sam
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org