-
1. Re: setting up a virtual host with 3.2.3 (without Apache)
erik777 Feb 17, 2004 11:11 AM (in response to martinbrice)As described in the admin/devl guide, do the following.
Step 1: Define the hosts in the jbossweb-tomcat41.sar/META-INF/jboss-service.xml Config attribute fragment:<attribute name="Config"> <Server> <Service name="JBoss-Tomcat"> <Engine name="MainEngine" defaultHost="vhost1"> <Logger className="org.jboss.web.tomcat.Log4jLogger" verbosityLevel="debug" category="org.jboss.web.localhost.Engine"/> <Host name="vhost1"> <Alias>vhost1.starkinternational.com</Alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="vhost1" suffix=".log" pattern="common" directory="/log"/> <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve"/> <!-- Default context parameters --> <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> <Host name="vhost2"> <Alias>vhost2.starkinternational.com</Alias> prefix="vhost2" suffix=".log" pattern="common" directory="/log"/> <!-- Access logger --> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="vhost2" suffix=".log" pattern="common" directory="/log"/> <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve"/> <!-- Default context parameters --> <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> </Engine> <!-- A HTTP/1.1 Connector on port 8080 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" address="" port="8080" minProcessors="5" maxProcessors="100" enableLookups="true" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/> </Service> </server> </attribute>
Step2: Define the Host to which the web app should be deployed using the WEB-INF/jboss-web.xml descriptor virtual-host element:<jboss-web> <!-- Deploy this war to vhost2 --> <virtual-host>vhost2.starkinternational.com</virtual-host> </jboss-web>
-
2. Re: setting up a virtual host with 3.2.3 (without Apache)
starksm64 Mar 5, 2004 11:38 AM (in response to martinbrice)As described in the admin/devl guide, do the following.
Step 1: Define the hosts in the jbossweb-tomcat41.sar/META-INF/jboss-service.xml Config attribute fragment:<attribute name="Config"> <Server> <Service name="JBoss-Tomcat"> <Engine name="MainEngine" defaultHost="vhost1"> <Logger className="org.jboss.web.tomcat.Log4jLogger" verbosityLevel="debug" category="org.jboss.web.localhost.Engine"/> <Host name="vhost1"> <Alias>vhost1.starkinternational.com</Alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="vhost1" suffix=".log" pattern="common" directory="/log"/> <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve"/> <!-- Default context parameters --> <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> <Host name="vhost2"> <Alias>vhost2.starkinternational.com</Alias> prefix="vhost2" suffix=".log" pattern="common" directory="/log"/> <!-- Access logger --> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="vhost2" suffix=".log" pattern="common" directory="/log"/> <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve"/> <!-- Default context parameters --> <DefaultContext cookies="true" crossContext="true" override="true"/> </Host> </Engine> <!-- A HTTP/1.1 Connector on port 8080 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" address="" port="8080" minProcessors="5" maxProcessors="100" enableLookups="true" acceptCount="10" debug="0" connectionTimeout="20000" useURIValidationHack="false"/> </Service> </server> </attribute>
Step2: Define the Host to which the web app should be deployed using the WEB-INF/jboss-web.xml descriptor virtual-host element:<jboss-web> <!-- Deploy this war to vhost2 --> <virtual-host>vhost2.starkinternational.com</virtual-host> </jboss-web>
-
3. Re: setting up a virtual host with 3.2.3 (without Apache)
erik777 Mar 14, 2004 12:34 AM (in response to martinbrice)This certainly helped, as it now recognizes the virtual-host setting. However, my problem is that I need it to support multiple virtual host settings. This is to support escalation from development to testing to production, each having a diferent virtual host name.
I have alias tags in the host setting of jbossweb-service.xml. If I change the virtual-host setting in jboss-web.xml to any of them, it works only for that host name. This is good in that it indicates that my alias tags are working. However, I need it to work for all the alias tags for that host.
If I try to set more than one virtual-host tag, I get the following error:
org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/jboss-web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected only one virtual-host tag)
The bottom line is that JBoss needs to support multiple virtual-host tags, or have a means to support virtual host aliases.
Is there a workaround? Is a fix in the works?