-
1. Re: Hosting multiple domains with JBoss over DSL
frodeh Jan 21, 2003 5:52 AM (in response to dbronk)This depends a bit.
1. Are you using Jetty ?
2. Does each of the virtual-hosts map to separate webapps?
3. Do you intend to programmatically seperate the content on each alias ?
I have on my Jboss 3.0.4 with default Jetty only 1 IP-address, and have set up 3 different virtual-hosts with apps mapped to root.
In one of the apps (mapped to root) i have made a set of aliases, and the webapp serve different content based on the host-name in the request.
Frode -
2. Re: Hosting multiple domains with JBoss over DSL
dbronk Jan 21, 2003 8:08 AM (in response to dbronk)I am using Jetty.
No, each virutal host does not map to a separate webapp although I suppose I could. I need www.myco1.com, shop.myco1.com, mail.myco1.com as well as www.my-co1.com to all go to my myco.war webapp.
I know that if it is a one to one from virtual host to webapp that is easy, but I need multiple virtual hosts to point to a single webapp. This way a user that enters www.myco1.com, myco1.com, www.my-co1.com, etc will all get to me and run the same webapp.
Thanks,
Dale -
3. Re: Hosting multiple domains with JBoss over DSL
frodeh Jan 21, 2003 8:42 AM (in response to dbronk)OK.
I suppose you have deployed as a ear in order to map the webapp to root.
In jbboss-web.xml do
<jboss-web>
<virtual-host>virtualhost_1</virtual-host>
</jboss-web>
(Name doesn't matter, only internal use)
in jetty-web.xml do :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
www.myco1.com
www.my-co1.com
shop.myco1.com
mail.myco1.com
jsp
scratchdir
(path to saved,compiled jsp's)
Then all request to those hosts will be redirected to this webapp.
The last part will enable you to keep the compiled JSP's between restarts of the webapp and JBoss. Just put it in a directory unique for this webapp, and in a place where it doesn't get scratched. Perhaps in the ear.
Frode -
4. Re: Hosting multiple domains with JBoss over DSL
dbronk Jan 21, 2003 3:02 PM (in response to dbronk)Thank you very much! I'll give this a try. Two last question... I like the idea of specifying where the compiled jsp's go and keeping them between restarts...
1. JBoss is smart enough to recompile the jsp when a newer jsp is deployed, correct?
2. How can I specify a different jsp compile directory for each app? By your example, it looks like you are setting a single directory for all jsp's from all apps.
Thanks again,
Dale -
5. Re: Hosting multiple domains with JBoss over DSL
frodeh Jan 21, 2003 4:31 PM (in response to dbronk)Hello .
1. Yes, no problem (unless you have deployed a compressed WAR, and the WAR is unpacked every restart, then each JSP may be given new timestamps and recompile anyway)
2. There is one jetty-web.xml and jboss-web.xml for each webapp (in the WEB-INF directory inside the WAR), so the specs given is for each webapp. You MUST specify different paths for each webapp, if not, any duplicate JSP-name will give you a headace....
It's if you use the webdefault.xml-file in the jbossweb.sar you specify defaults for all webapps.
Frode -
6. Re: Hosting multiple domains with JBoss over DSL
dbronk Jan 26, 2003 9:27 PM (in response to dbronk)I finally got a chance to test this and am getting errors.
Here is my jboss-web.xml:
<jboss-web>
<virtual-host>dale</virtual-host>
<context-root>/</context-root>
</jboss-web>
Here is my jetty-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
www.dale.com
www.dale-dale.com
shop.dale.com
mail.dale.com
jsp
scratchdir
C:\ServerApps\jboss\server\default\deploy\dale.war\WEB-INF\CompiledJsp
Here is my exception during startup of JBoss 3.0.4:
21:33:23,099 INFO [MainDeployer] Starting deployment of package: file:/C:/ServerApps/jboss/server/d
efault/deploy/dale.war/
21:33:23,379 INFO [jbossweb] Registered jboss.web:Jetty=0,JBossWebApplicationContext=1,context=/
21:33:23,800 WARN [jbossweb] WARNING: Configuration error file:/C:/ServerApps/jboss/server/default/
deploy/dale.war/
java.lang.IllegalStateException: No Method: www.dale.com
www.dale-dale.comshop.dale.commail.dale.com on class org.jboss.je
tty.JBossWebApplicationContext
at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:501)
at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:231)
at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:163)
at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:432)
at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
at org.jboss.jetty.Jetty.deploy(Jetty.java:414)
at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284
)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy4.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java
:656)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentSca
Thanks,
Dale -
7. Re: Hosting multiple domains with JBoss over DSL <Figured it
dbronk Jan 26, 2003 9:55 PM (in response to dbronk)jetty-web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
false
www.james.com
www.james-james.com
shop.james.com
mail.james.com
jsp
scratchdir
C:\ServerApps\jboss\server\default\deploy\james.ear\CompiledJsp
Thanks for your help! This is working great!
Dale