Add an <Alias> element.

            <Host name="www.myhost.com" debug="0" appBase="webapps"
unpackWARs="true">
            <Alias>myhost.com</Alias>

RS



                                                                                       
                              
                      poo <[EMAIL PROTECTED]>                                              
                              
                      Sent by:                           To:       
[EMAIL PROTECTED]                  
                      [EMAIL PROTECTED]        cc:                           
                              
                      ceforge.net                        Subject:  Re: [JBoss-user] 
Virtual hosting question         
                                                                                       
                              
                                                                                       
                              
                      12/17/02 12:54 PM                                                
                              
                      Please respond to                                                
                              
                      jboss-user                                                       
                              
                                                                                       
                              
                                                                                       
                              




All I basically want to do is have www.myhost.com and myhost.com use the
same webapp(!)  Any info on how to do this would be great!   The example
that Scott presents below addresses the case where 2 different vhosts
use different webapps.  I want 2 different vhosts to use the same
webapp.   I've combed the list and doco and can't find this addressed
anywhere.  Any help would be greatly appreciated!!

using jboss-3.2.0beta2_tomcat-4.1.12 w/ jdk1.4 on linux

Thanks!

S

btw. despite my inability to configure it, jboss rules!

Gary S. Cuozzo wrote:

> i'm doing this right now and just got it working today.  i have a
> single webapp "/global" that will serve all our virtual host customers
> a set of functionality.  i'm using jboss 3.x series with embedded
> tomcat front-ended with apache.
>
> i just have a straight-up .war file right now, with no jboss-web file.
> just a bunch of servlets/jsp's.  all i did was tell apache to pass all
> requests for "/global" to tomcat via the connector with the proper
> mount command in httpd.conf.
>
> i'm on my way out, but can send more detailed info tomorrow if you
> need it.
>
> hth,
> gary.
>
>
> poo wrote:
>
>> Hello,
>>
>> Is there a way to configure multiple virtual hosts to use the same
>> webapp?  It appears that jboss-web only allows one virtual-host param.
>>
>> thanks
>>
>> S
>>
>>
>> Scott M Stark wrote:
>>
>>> I looked at the problem this morning and the problem is that you
>>> have to setup
>>> Host elements that matches the virtual host names used in the
>>> jboss-web.xml,
>>> for example:
>>>
>>>    <attribute name="Config">
>>>      <Server>
>>>         <Service name = "JBoss-Tomcat">
>>>            <Engine name="MainEngine" defaultHost="localhost">
>>>               <Logger className = "org.jboss.web.catalina.Log4jLogger"
>>>                  verbosityLevel = "trace" category =
>>> "org.jboss.web.localhost.Engine"/>
>>> ...
>>>               <Host name="a.dot.com">
>>>                  <Valve className =
>>> "org.apache.catalina.valves.AccessLogValve"
>>>                     prefix = "a_access" suffix = ".log"
>>>                     pattern = "common" directory =
>>> "../server/default/log" />
>>>                  <DefaultContext cookies = "true" crossContext =
>>> "true" override = "true" />
>>>               </Host>
>>>               <Host name="b.dot.com">
>>>                  <Valve className =
>>> "org.apache.catalina.valves.AccessLogValve"
>>>                     prefix = "b_access" suffix = ".log"
>>>                     pattern = "common" directory =
>>> "../server/default/log" />
>>>                  <DefaultContext cookies = "true" crossContext =
>>> "true" override = "true" />
>>>               </Host>
>>> ...
>>>
>>> With this I can deploy two wars to the a.dom.com and b.dot.com
>>> virtual hosts
>>> with both using the root context:
>>>
>>> 14:34:03,706 INFO  [MainDeployer] Starting deployment of package:
>>> file:/C:/tmp/JBoss/jboss-3.0.3RC1/server/tomcat/deploy/a.war/
>>> 14:34:03,716 INFO  [EmbeddedCatalinaServiceSX] deploy, ctxPath=,
>>> warUrl=file:/C:
>>> /tmp/JBoss/jboss-3.0.3RC1/server/tomcat/deploy/a.war/
>>> 14:34:03,786 INFO  [Engine] WebappLoader[]: Deploying class
>>> repositories to work
>>> directory C:\tmp\JBoss\jboss-3.0.3RC1\catalina\work\a.dot.com\_
>>> 14:34:03,786 INFO  [Engine] StandardManager[]: Seeding random number
>>> generator class java.security.SecureRandom
>>> 14:34:03,786 INFO  [Engine] StandardManager[]: Seeding of random
>>> number generator has been completed
>>> 14:34:04,828 INFO  [Engine] ContextConfig[]: Added certificates ->
>>> request attribute Valve
>>> 14:34:05,048 INFO  [EmbeddedCatalinaServiceSX] Using Java2 parent
>>> classloader delegation: true
>>> 14:34:05,048 INFO  [Engine] StandardWrapper[:default]: Loading
>>> container servlet default
>>> 14:34:05,048 INFO  [Engine] StandardWrapper[:invoker]: Loading
>>> container servlet invoker
>>> 14:34:05,098 INFO  [MainDeployer] Deployed package:
>>> file:/C:/tmp/JBoss/jboss-3.0
>>> .3RC1/server/tomcat/deploy/a.war/
>>> 14:34:05,098 INFO  [MainDeployer] Starting deployment of package:
>>> file:/C:/tmp/JBoss/jboss-3.0.3RC1/server/tomcat/deploy/b.war/
>>> 14:34:05,118 INFO  [EmbeddedCatalinaServiceSX] deploy, ctxPath=,
>>> warUrl=file:/C:
>>> /tmp/JBoss/jboss-3.0.3RC1/server/tomcat/deploy/b.war/
>>> 14:34:05,128 INFO  [Engine] WebappLoader[]: Deploying class
>>> repositories to work
>>> directory C:\tmp\JBoss\jboss-3.0.3RC1\catalina\work\b.dot.com\_
>>> 14:34:05,128 INFO  [Engine] StandardManager[]: Seeding random number
>>> generator class java.security.SecureRandom
>>> 14:34:05,128 INFO  [Engine] StandardManager[]: Seeding of random
>>> number generator has been completed
>>> 14:34:05,198 INFO  [Engine] ContextConfig[]: Added certificates ->
>>> request attribute Valve
>>> 14:34:05,268 INFO  [EmbeddedCatalinaServiceSX] Using Java2 parent
>>> classloader delegation: true
>>> 14:34:05,268 INFO  [Engine] StandardWrapper[:default]: Loading
>>> container servlet default
>>> 14:34:05,268 INFO  [Engine] StandardWrapper[:invoker]: Loading
>>> container servlet invoker
>>> 14:34:05,358 INFO  [MainDeployer] Deployed package:
>>> file:/C:/tmp/JBoss/jboss-3.0.3RC1/server/tomcat/deploy/b.war/
>>>
>>> testsuite 371>wget http://b.dot.com:8080/index.html
>>> --14:45:55--  http://b.dot.com:8080/index.html
>>>           => `index.html.2'
>>> Resolving b.dot.com... done.
>>> Connecting to b.dot.com[127.0.0.1]:8080... connected.
>>> HTTP request sent, awaiting response... 200 OK
>>> Length: 64 [text/html]
>>>
>>> 100%[====================================>] 64
>>> 62.50K/s    ETA 00:00
>>>
>>> 14:45:55 (62.50 KB/s) - `index.html.2' saved [64/64]
>>>
>>> testsuite 372>wget http://a.dot.com:8080/index.html
>>> --14:46:01--  http://a.dot.com:8080/index.html
>>>           => `index.html.3'
>>> Resolving a.dot.com... done.
>>> Connecting to a.dot.com[172.17.66.55]:8080... connected.
>>> HTTP request sent, awaiting response... 200 OK
>>> Length: 64 [text/html]
>>>
>>> 100%[====================================>] 64
>>> 62.50K/s    ETA 00:00
>>>
>>> Support for virtual hosting needs to be setup in the
>>> tomcat4-service.xml descriptor Config.
>>>
>>> xxxxxxxxxxxxxxxxxxxxxxxx
>>> Scott Stark
>>> Chief Technology Officer
>>> JBoss Group, LLC
>>> xxxxxxxxxxxxxxxxxxxxxxxx
>>>
>>> ----- Original Message -----
>>> From: "Brian Topping" <[EMAIL PROTECTED]>
>>> To: <[EMAIL PROTECTED]>
>>> Cc: <[EMAIL PROTECTED]>
>>> Sent: Thursday, September 19, 2002 6:40 PM
>>> Subject: RE: [JBoss-user] Virtual hosting question
>>>
>>>
>>> I took a look at this but don't know what to do next.
>>> EmbeddedCatalina.findHost() is returning the default host in the
>>> engine for
>>> both queries, each with the correct different virtual host names.  When
>>> StandardHost.addChild() is called the first time, of course it works
>>> fine,
>>> dies on the second time, since the empty context root is trying to
>>> be added
>>> to the same StandardHost (the default host) twice.
>>>
>>> Should EmbeddedCatalina.findHost() be returning two different
>>> StandardHosts?
>>> It seems like it, but where should they get created, before the call to
>>> EmbeddedCatalina.findHost() or inside it?
>>>
>>> Thanks,
>>>
>>> -b
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Scott M Stark [mailto:[EMAIL PROTECTED]]
>>>> Sent: Wednesday, September 18, 2002 12:27 PM
>>>> To: [EMAIL PROTECTED]
>>>> Subject: Re: [JBoss-user] Virtual hosting question
>>>>
>>>>
>>>> It should work and it does work fine with Jetty.  I'll have to look
>>>> into the tomcat behavior.
>>>>
>>>> xxxxxxxxxxxxxxxxxxxxxxxx
>>>> Scott Stark
>>>> Chief Technology Officer
>>>> JBoss Group, LLC
>>>> xxxxxxxxxxxxxxxxxxxxxxxx
>>>>
>>>> ----- Original Message -----
>>>> From: "Brian Topping" <[EMAIL PROTECTED]>
>>>> To: <[EMAIL PROTECTED]>
>>>> Sent: Wednesday, September 18, 2002 8:10 AM
>>>> Subject: [JBoss-user] Virtual hosting question
>>>>
>>>>
>>>> Hi guys,
>>>>
>>>> I have map a different war deployment at the root of several different
>>>> name-based virtual hosts.  In other words, http://a.foo.com and
>>>> http://b.foo.com should map directly to separate .war files.
>>>>
>>>> Right now, I have two separate war deployments, each with a
>>>> jboss-web.xml.
>>>> They look like:
>>>>
>>>> <jboss-web>
>>>> <context-root>/</context-root>
>>>> <virtual-host>a.digidemic.com</virtual-host>
>>>> </jboss-web>
>>>>
>>>> and
>>>>
>>>> <jboss-web>
>>>> <context-root>/</context-root>
>>>> <virtual-host>b.digidemic.com</virtual-host>
>>>> </jboss-web>
>>>>
>>>> but I am getting an error:
>>>>
>>>> 10:52:19,448 ERROR [URLDeploymentScanner] MBeanException:
>>>> Exception in MBean
>>>> operation 'checkIncompleteDeployments()'
>>>> Cause: Incomplete Deployment listing:
>>>> Packages waiting for a deployer:
>>>>  <none>
>>>> Incompletely deployed packages:
>>>> [org.jboss.deployment.DeploymentInfo@716004b8 {
>>>> url=file:/C:/dev/jboss-3.0.1_tomcat-4.0.4/server/default/deplo
>>>> y/b.war/ }
>>>>  deployer: org.jboss.web.catalina.EmbeddedCatalinaServiceSX@ff2e265c
>>>>  status: Deployment FAILED reason: Error during deploy; -
>>>> nested throwable:
>>>> (java.lang.IllegalArgumentException: addChild:  Child name ''
>>>> is not unique)
>>>>  state: FAILED
>>>>  watch:
>>>> file:/C:/dev/jboss-3.0.1_tomcat-4.0.4/server/default/deploy/b.
>>>>
>>>
>>>
>>> war/WEB-INF/web
>>> .xml
>>>  lastDeployed: 1032360729806
>>>  lastModified: 1032360644054
>>>  mbeans:
>>> ]MBeans waiting for classes:
>>>  <none>
>>> MBeans waiting for other MBeans:
>>>  <none>
>>>
>>> It makes sense what is going on, both are trying to use the same root
>>> mapping.
>>>
>>> Is there a way around this?
>>>
>>> Thanks for any info,
>>>
>>> brian
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.NET email is sponsored by: AMD - Your access to the experts
>>> on Hammer Technology! Open Source & Linux Developers, register now
>>> for the AMD Developer Symposium. Code: EX8664
>>> http://www.developwithamd.com/developerlab
>>> _______________________________________________
>>> JBoss-user mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>>>
>>>
>>> -------------------------------------------------------
>>> This sf.net email is sponsored by:ThinkGeek
>>> Welcome to geek heaven.
>>> http://thinkgeek.com/sf
>>> _______________________________________________
>>> JBoss-user mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This sf.net email is sponsored by:ThinkGeek
>>> Welcome to geek heaven.
>>> http://thinkgeek.com/sf
>>> _______________________________________________
>>> JBoss-user mailing list
>>> [EMAIL PROTECTED]
>>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>>>
>>>
>>
>>
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:
>> With Great Power, Comes Great Responsibility Learn to use your power
>> at OSDN's High Performance Computing Channel
>> http://hpc.devchannel.org/
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility Learn to use your power
> at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user





-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user





This transmission is intended to be strictly confidential. If you are not
the intended recipient of this message, you may not disclose, print, copy
or disseminate this information. If you have received this in error, please
reply and notify the sender (only) and delete the message. Unauthorized
interception of this e-mail is a violation of federal criminal law.




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to