Deploying Magnolia as a WAR file on JBoss Application Server.

Deploying a WAR

To deploy a WAR file on JBoss AS:

  1. Rename the Magnolia .war file you downloaded to magnoliaAuthor.war.
  2. Copy the file:
    1. JBoss AS 7: Copy the .war file to JBOSS_HOME/standalone/deployments.
    2. JBoss AS 6: Copy the .war file to JBOSS_HOME/server/default/deploy.

The application server will automatically pick up the file and deploy it.

(warning) JBoss AS unpacks .war files to a tmp directory and deletes the directory as part of the shutdown process. This means that every time JBoss AS restarts, the Magnolia webapp forgets everything – modules, repository, license key. To get around this issue, you can deploy the Magnolia webapp as an extracted (unpacked) directory or configure Magnolia to store the repository outside the tmp directory. Alternatively, specify the following paths in your magnolia.properties configuration. If you point the paths outside of JBoss AS tmp directory, Magnolia will not reinstall on every startup and they will not be deleted on every shutdown.

magnolia.home=/somewhere/outside/of/jboss/tmp/folder
magnolia.cache.startdir=${magnolia.home}/cache
magnolia.upload.tmpdir=${magnolia.home}/tmp
magnolia.exchange.history=${magnolia.home}/history
magnolia.repositories.home=${magnolia.home}/repositories
magnolia.logs.dir=${magnolia.home}/logs

Deploying an extracted directory

To deploy an extract directory:

  1. Extract the Magnolia war file to a /magnoliaAuthor.war directory.
  2. Copy the directory:
    1. JBoss AS 7: Copy the directory to JBOSS_HOME/standalone/deployments.
    2. JBoss AS 6: Copy the directory to JBOSS_HOME/server/default/deploy.
  3. Create an empty file magnoliaAuthor.war.dodeploy.

The application server will pick up extracted directory on startup and will deploy it.

Starting JBoss AS and accessing Magnolia

  1. Restart JBoss AS.
  2. Access Magnolia AdminCentral at http://localhost:8080/<WAR file name>

(warning) JBoss AS7+. It may happen that the Magnolia application is not deployed because of deployment timeout. You can avoid this by setting the deployment-timeout parameter to higher value in JBOSS_HOME/standalone/configuration/standalone.xml. The default is 60 seconds.

standalone.xml
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
   <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="120"/>
</subsystem>

Optional: Changing the context path

Without this file placed under WEB-INF folder, the context path will be the web application's folder name by default.

  1. Stop JBoss AS.
  2. Create a jboss-web.xml file in WEB-INF folder of your Magnolia instance.
  3. Add the following section in the file. Replace YourContextPath with your actual context path which can be /for a public instance, for example.

    <jboss-web>
       <context-root>/YourContextPath</context-root>
    </jboss-web>
    

    Restart JBoss AS. Your webapp should be available at http://localhost:8080/<YourContextPath>

Deploying a public instance

  1. Perform the same steps as above but edit the context-root value and rename the WAR file magnoliaPublic.war.
  2. Once the bootstrapping of the repository has finished, configure the instance in AdminCentral.
  3. Log in as superuser/superuser on http://localhost:8080/magnoliaPublic and follow the instructions in Changing author to public instance.
  4. Edit the subscriber details in the author instance to match the details of the public instance if you used another name for the public instance.

Optional: Configure a JNDI Datasource

JBoss AS JNDI Datasource Setup

Learn more

JBoss / Wildfly Documentation

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels