users@glassfish.java.net

tomcat virtual hosting question

From: <glassfish_at_javadesktop.org>
Date: Sat, 08 May 2010 23:03:28 PDT

I installed tomcat 5.5 on d:\Tomcat 5.5 which is a directly from tomcat.apache.com homepage not xampp
 
Previously, i have defined something like on c:\Program Files\xampp\apache\conf\extra\httpd-vhosts.conf on xampp-
script is :
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
## ServerAdmin webmaster_at_dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
##</VirtualHost>

##<VirtualHost *:80>
## ServerAdmin webmaster_at_dummy-host2.example.com
## DocumentRoot /www/docs/dummy-host2.example.com
## ServerName dummy-host2.example.com
## ErrorLog @rel_logfiledir@/dummy-host2.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host2.example.com-access_log common
##</VirtualHost>


<VirtualHost *:80>
     ServerAdmin webmaster_at_skywalk-ent.com
     DocumentRoot "C:/Program Files/xampp/htdocs/Public/myweb/"
     ServerName localhost
     ServerAlias www.skywalk-ent.com
## ErrorLog @rel_logfiledir@/skywalk-ent.com-error_log
## CustomLog @rel_logfiledir@/skywalk-ent.com-access_log common
</VirtualHost>


<VirtualHost *:80>
    ServerAdmin webmaster_at_site1.com
    DocumentRoot "C:/Program Files/xampp/htdocs/Public/myweb/site1/"
    ServerName site1.loc
    ServerAlias www.adex-hk.com
## ErrorLog @rel_logfiledir@/site1.com-error_log
## CustomLog @rel_logfiledir@/site1.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster_at_site2.com
    DocumentRoot "C:/Program Files/xampp/htdocs/Public/myweb/site2/"
    ServerName site2.loc
## ErrorLog @rel_logfiledir@/site2.com-error_log
## CustomLog @rel_logfiledir@/site2.com-access_log common
</VirtualHost>

this is to define if
i have to define several sites such as site1, site2, site3 etc., Then how to do the same effect for virtual hosting on Tomcat
please instruct and tell
 
On c: windows\systems\drivers\etc\hosts
script is :
127.0.0.1 localhost
127.0.0.1 site1.loc
127.0.0.1 site2.loc
127.0.0.1 site3.loc
i also specify site1,site2,site3 etc., How to do it on tomcat?
 
Anyhow, i would like to run several website on tomcat 5.5, please tell how to config and procedure for virtual host and
any further additional efforts in order to serve more than one site on the tomcat 5.5 webserver. Please give procedure.
 
 
thanks,
gar
[Message sent by forum member 'garyww']

http://forums.java.net/jive/thread.jspa?messageID=469063