You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marty Pitt NZ <ma...@me.com> on 2009/11/17 11:56:11 UTC

Testing Tomcat with Virtual Hosts

'm trying to test Tomcat virtual hosts on my dev machine (windows 7/Tomcat
6).

I'd like to have requests for localhost, test1.localhost and test2.localhost
all route through to the same tomcat instance.

I've edited my hosts file to look as follows:

127.0.0.1       localhost
::1             localhost
127.0.0.1       test1.localhost
localhost       test2.localhost

And added modified the Engine in server.xml as follows:

<Engine defaultHost="localhost" name="Catalina">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
        resourceName="UserDatabase" />
    <Host appBase="webapps" autoDeploy="true" name="localhost"
        unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
        <Alias>test1.localhost</Alias>
        <Alias>test2.localhost</Alias>
    </Host>
</Engine>
However, I'm getting a 404 when hitting test1.localhost:8080/myWebApp,
although localhost:8080/myWebApp works fine.

I can ping test1.localhost fine.

What have I missed?
-- 
View this message in context: http://old.nabble.com/Testing-Tomcat-with-Virtual-Hosts-tp26387899p26387899.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: Testing Tomcat with Virtual Hosts

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marty Pitt NZ [mailto:martypitt@me.com]
> Subject: Testing Tomcat with Virtual Hosts

> I've edited my hosts file to look as follows:
> 127.0.0.1       localhost
> ::1             localhost
> 127.0.0.1       test1.localhost
> localhost       test2.localhost

The last line is a little odd; why aren't you using 127.0.0.1 for test2.localhost?

> However, I'm getting a 404 when hitting test1.localhost:8080/myWebApp,
> although localhost:8080/myWebApp works fine.

Can't see anything wrong in what you've done in the Tomcat config.  Try enabling the AccessLogValve and see what it says.

 - 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