Virtualising Magnolia CMS

In a sharp left-turn for the danwalmsley.com ouvre, what follows is instructions for virtualising Magnolia CMS. Magnolia is an open-source Content Management system available in both community and enterprise versions, and is elegant and easy-to-use.

If you want to deploy Magnolia for multiple clients across multiple virtual domains hosted through a single instance of Apache HTTPD and a single instance of Apache Tomcat, read on.

Virtualising Magnolia

Virtualises magnolia for an apache virtual host under / for root and /admin for admin stuff

What you get:

  • myclient.com: magnolia public content (i.e. everything normally under /magnoliaPublic)
  • myclient.com/admin: magnolia authoring interface (i.e. everything normally under /magnoliaAuthor)

Variables: $CLIENT = client name, e.g. myclient $CLIENT_HOSTNAME = client host name to be proxied, e.g. myclient.com $CLIENT_PORT = selected port on which Tomcat should host the site, e.g. 8082. $TOMCAT_HOME = installation directory of TOMCAT

Tomcat Config

mkdir $TOMCAT_HOME/webapps_$CLIENT

unzip magnoliaPublic.war to webapps$CLIENT/ROOT unzip magnoliaAuthor.war to webapps$CLIENT/admin

cd $TOMCAT_HOME/conf/Catalina

mkdir $CLIENT_HOSTNAME (e.g. mkdir myclient.com)

edit $TOMCAT_HOME/conf/server.xml to include the following elements:

<pre class=ā€¯prettyprint>

  <Host name="$CLIENT_HOSTNAME" debug="0" appBase="webapps_$CLIENT" unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- do SSO for this container -->
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
               debug="0"/>

  </Host> ]]>--></pre>

Configure Apache

Enable mod_proxy

Create a config, $CLIENT.conf: <pre class="prettyprint"><![CDATA[ <VirtualHost *> ServerName $CLIENT_HOSTNAME

ProxyRequests Off
<Directory proxy:*>
    Order deny,allow
    Allow from all
</Directory>

ProxyPass / http://localhost:$CLIENT_PORT/
ProxyPassReverse / http://localhost:$CLIENT_PORT/

<Location />
    Order allow,deny
    Allow from all
</Location>

</VirtualHost> ]]></pre>