virtual hosting: how to map one ear file per virtual host
joe543 Dec 28, 2003 4:39 PMHi
My environment: gnu linux 2.4.x, jdk 1.4.1, apache httpd 2.0.48, jboss3.2.1+tomcat4.1.24
I want to deploy one ear file per virtual host. (notice I said 'ear' file not 'war' file - is it possible to associate one ear file per virtual host? The rest of this message assumes I can use an ear
file instead of a war file).
I am trying to find the reason why I am getting the following msg when hitting my server using the virtual host name, 'http://www.vhost1.co.uk':
<jboss-server-log-snippet>
...
20:33:39,580 INFO [Host=vhost1] StandardHost[www.vhost1.co.uk]: MAPPING configuration error for request URI /
...
</jboss-server-log-snippet>
What I would like is to type :
'http://www.vhost1.co.uk'
into my browser URL locator and have it forward me to my jboss-deployed 'myapp1.ear',
'http://www.vhost2.co.uk'
into my browser URL locator and have it forward me to my jboss-deployed 'myapp2.ear' etc, etc.
I specifically don't want to have to type :
'http://www.vhost1.co.uk/myapp1' (this does work by the way)
because to me that would be defeating the purpose of virtual hosting (the way I understand it anyway).
My config is as follows:
httpd.conf:
#########
<VirtualHost *:80>
ServerName www.vhost1.co.uk
DocumentRoot /usr/local/jboss/server/test/deploy/myapp1
ErrorLog logs/vhost1-errorlog
<Location "/*">
JkUriSet worker ajp13:192.168.0.1:8009
workers2.properties:
#################
# only at beginnin. In production uncomment it out
[logger.apache2]
level=DEBUG
[shm]
file=/logs/jk2.shm
size=1048576
# Example socket channel, override port and host.
[channel.socket:192.168.0.1:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:192.168.0.1:8009]
channel=channel.socket:192.168.0.1:8009
# Uri mapping
[uri:10.0.0.10/*]
worker=ajp13:192.168.0.1:8009
[uri:www.vhost1.co.uk/*]
worker=ajp13:192.168.0.1:8009
jboss-service.xml:
###############
<!-- Default context parameters -->
<!-- Access logger -->
jboss-web.xml:
##############
<jboss-web>
<context-root>/myapp1</context-root>
<security-domain>java:/jaas/myapp1-dbs-1</security-domain>
<virtual-host>www.vhost1.co.uk</virtual-host>
</jboss-web>
Any ideas as to why I'm getting the above error msg? I have successfully managed to setup virtual hosting on standalone apache httpd2 using static resources and also on standalone tomcat integrated
via jk2 with apache httpd2 where vhost1 is mapped to myapp1 and vhost2 is mapped to myapp2 (war files) so now the final hurdle is getting it to work on jboss321tomcat4124 bundle.
Any help is much appreciated.
jfc