You have a host set up on mysite.com. Unfortunately, when running Magnolia it will appear like mysite.com/magnoliaPublic, which is not really a nice url.
There are other options like running Apache in front and routing with a proxy or something from mysite.com to your magnoliaPublic, but we've found the easiest to be running only Tomcat, as redirection and proxy has implications for activation and caching.
This procedure requires that you know how to configure and fiddle with Tomcat.
- Set up your tomcat to listen on port 80 (instead of 8080 which is default)
- Configure a host with name "mysite.com"
- Set up a context within the host with an empty path="" - this will make it the default context for this context
- Rename the magnoliaPublic instance to "ROOT" and deploy it to the docBase of the default context above
- Deploy the magnoliaAuthor instance to the host as normal (or rename if you like)
- Access magnoliaAuthor through mysite.com/magnoliaAuthor
- Change subscriber to the following
Magnolia 2.x:
Here's an example snippet from server.xml - you probably don't want to configure the contexts in this file, rather in their own ROOT.xml and magnoliaAuthor.xml inside $CATALINA_HOME/conf/Catalina/mysite.com/ but I put it all here for simplicity. Note that I include the tomcat manager for easy magnolia restarts.
<Host name="mysite.com" appBase="/home/mysite/webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<!-- log file for host note: cron will rotate monthly -->
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="/home/mysite/weblogs" prefix="access"
suffix=".log" pattern="combined" rotatable="false" resolveHosts="false" />
<!-- Contexts -->
<Context path="" docBase="/home/mysite/webapps/ROOT"/>
<Context path="author" docBase="/home/mysite/webapps/magnoliaAuthor"/>
<Context path="/manager" docBase="/usr/local/tomcat/server/webapps/manager" debug="0" privileged="true"/>
</Host>
-------------- Part II ----------------
Also note this wiki page, and update it with your experiences, please!
Ferris N.
public in /webapps/ROOT/. author in /mgnlAuthorApps/magnoliaAuthor/.
This (Magnolia 2.1.3) setup is based on a configuration discussed on this forum. Rather than running author & public just in separate contexts, it further separates them in different Services, Ports, Engines, Hosts, & appBases. While getting it set up, I ran into many of the issues experienced by others who deploy Magnolia WAR's on their own Engine setup, and by going between the logs and the forum archives, I was able to get enough answers to get the configuration working.
Downloaded & unpacked Tomcat 5.5.15 (On Suse Linux 9). Added '/mgnlAuthorApps/' directory. Renamed 'magnoliaPublic.war. to 'ROOT.war' and placed in '/webapps/' directory. Placed 'magnoliaAuthor.war' in '/mgnlAuthor/' directory. Added Service Element for 'mgnlAuthor' to server config. Adjusted Port settings for 'Catalina' Service.
- Server: Port 8009
- Service: mgnlAuthor
- HTTP Connector: Port 8085
- AJP Connector: Port 8447
- Engine: mgnlAuthor
- Host: appBase mgnlAuthorApps
- Service: Catalina
- HTTP Connector: Port 8086
- AJP Connector: Port 8448
- Engine: Catalina
Tomcat 5.5.15 doesn't start with JDK 1.4, so installed 1.4 compatability package.
ROOT.war doesn't deploy with existing '/ROOT/' directory, so removed it.
Added context config for author & public (Added 'ROOT.xml' to '/conf/Catalina/localhost/' & '/mgnlAuthor/localhost/magnoliaAuthor.xml' to '/conf/'). docBase attribute causes warning in log saying 'docBase inside Host appBase will be ignored', so removed the attribute.
WAR's deploy. Browse to site. 'HTTP status 403 - Access forbidden'. Setup 'Tomcat Manager' webapp & works OK. Adjusting port numbers, file perms, & servlet-mapping doesn't help. Removing Lock files doesn't help. 'OutOfMemory' error as repositories initialize causes bootstrap to hang up so Tomcat forbids access. 'Magnolia with Tomcat' is setup to allocate more memory to Java, so the same needed to be done here.
In 'catalina.sh', added:
;:CATALINA_OPTS="-server -Xmx512m"
;:export CATALINA_OPTS
Better to do it the Magnolia way so removed above from catalina.sh, then add this to startup.sh:
;:export CATALINA_OPTS="$CATALINA_OPTS -Xms64M -Xmx512M"
To re-deploy the WAR's, stop Tomcat, delete the '/ROOT/' and '/magnoliaAuthor/' directories, start Tomcat.
:8086/ (magnoliaPublic) came up OK. :8086/magnoliaAuthor/ comes up 'HTTP 404 - Resource Not Available'
author came up OK when I browsed the CORRECT port (:8085/magnoliaAuthor/).
In magnoliaAuthor, changed the SubscriberConfig address to 'localhost:8086/', and the senderURL to 'http://localhost:8085/magnoliaAuthor'.
Activated superuser User & Role & SubscriberConfig. Not sure what order they should be, but I was able to edit & activate a content change.
Added the Tomcat AdminTool. In server config, configured a Global JNDI DataSource Resource, and DataSourceRealm and SingleSignOn valve elements for the Catalina Engine & Host. Setup tests out OK.
In its previous incarnation on JspWiki, this page was last edited on Mar 2, 2007 12:16:00 AM by Magnolia
Other known authors include :