[MAGNOLIA-1643] Magnolia does not deploy when using multiple virtual hosts Created: 25/Jul/07  Updated: 23/Jan/13  Resolved: 10/Aug/07

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: zam6ak Assignee: Philipp Bärfuss
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

3.1-SNAPSHOT
JBoss 4.0.5 / Tomcat 5.5


Attachments: Text File magnolia-debug.log    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

In order to perform load balancing while allowing multiple subscribers, we have to deploy 2 Magnolia public instances.
Each instance has to be is bound to 2 virtual host names - one for loadbalancing purposes and one for subscription purposes

For example

node1 - vhosts:
+site.company.org
+site01.company.org

node2 - vhosts
+site.company.org
+site02.company.org

With this setup a load balancing hardware (like Cisco Content Switch) can use site.company,org to perform load balancing while each individual instance can still be accessed using either site01 or site02 vhost.
Vhosting is used to allow multiple apps on the same server to have root context (deployed under /)

-----SETUP TO REPRODUCE EXCEPTION (JBoss 4.0.5) ----
1. add new Host entry to <jboss_root>/server/all/deploy/jbossweb-tomcat55.sar/server.xml.
Hhere is an example
<Host name="fn0161.company.org" autoDeploy="false" deployOnStartup="true" deployXML="false">
<Alias>fn0161</Alias>
<Valve className="org.apache.catalina.valves.AccessLogValve"
prefix="fn0161.company.org-"
suffix="-access_log"
pattern="%h %v %u %t "%r" %s %b "%

{Referer}

i" "%

{User-Agent}

i" "%

{Cookie}

i""
directory="${jboss.server.log.dir}/access"
rotatable="true"
fileDateFormat="yyyy-MM-dd"
resolveHosts="false" />
</Host>

2. Add jboss-web to WEB-INF/ folder of the webapp.
Here is an exmple
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
<jboss-web>
<context-root>/</context-root>
<virtual-host>fn0161.company.org</virtual-host>
<virtual-host>localhost</virtual-host>
</jboss-web>

The above setup will allow Magnolia to be deployed under root context "/" and only under 2 virtual hosts - "localhost" and "fn0161"

After restart the exception is thrown (see attached log file).
If one of the vhosts is removed, everything is fine....



 Comments   
Comment by Magnolia International [ 27/Jul/07 ]
  • please use attachment for large stacktraces
  • this looks to me like a configuration issue of some sorts, not a magnolia bug.
  • the line "2007-07-25 15:46:20,703 ERROR [org.apache.catalina.core.StandardContext] Context [] startup failed due to previous errors" tells you there was an exception earlier - it is probably in a log somewhere, and that's most likely where the actual interesting information will be.
Comment by zam6ak [ 27/Jul/07 ]

Attaching magnolia-debug.log
Log inticates existing file lock which is in reallity not a case (I double checked that .lock file was not in the repo on the filesystem)
What I believe is happening is that somehow (since multiple vhosts are being used) Magnolia is trying to "deploy" itselft under different contexts but after 1st context deployment (when the .lock file is created) the 2nd context fails....I could be wrong though....

Comment by zam6ak [ 27/Jul/07 ]

Removed long and uninformative stacktrace from the issue Description

Comment by Philipp Bracher [ 10/Aug/07 ]

The described configuration triggers twice a start of the context. Since the context listener starts the application this initializes jackrabbit twice as well. This is dangerous! Don't do that! Use an alias instead (server.xml).

Remark: to define a subscriber you can use the ip and context if you have to.

We normally don't configure this on the jboss or tomcat we use an apache in front to handle virtual hosts resolution.

Generated at Mon Feb 12 03:28:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.