3.8. Installing the Nexus WAR

Nexus Open Source is available as a WAR which can be run in an existing application server or servlet container. The Nexus Open Source WAR has been successfully tested in Tomcat, Jetty, and Resin. If you need to run Nexus under Glassfish, please see Section 3.8.1, “Running the Nexus WAR in Glassfish”. To download the Nexus Open Source WAR, go to http://nexus.sonatype.org/using/download.html. Click on the Download Site link and then download the Nexus WAR nexus-webapp-1.6.0.war. Once you have downloaded the Nexus Open Source WAR, you can install it in a servlet container or application server.

The process for installing a WAR in an servlet container or application server is going to vary for each specific application. Often, this installation process is as simple as dropping a WAR file in a special directory and restarting the container. For example, to install the Nexus WAR in Tomcat, drop the nexus-webapp-1.6.0.war file in ${TOMCAT_HOME}/webapps and restart your Tomcat instance. Assuming that Tomcat is configured on port 8080 once Tomcat is started, Nexus will be available on http://localhost:8080/nexus-webapp-1.6.0. If you would like a less verbose URL, copy nexus-webapp-1.6.0.war to a file named nexus.war before copying the distribution to \${TOMCAT_HOME}/webapps.

Note

When installing Nexus as a WAR in an application server or servlet container, it automatically creates a sonatype-work directory in ~/sonatype-work. This directory contains all of the necessary configuration and repository storage for Nexus.

3.8.1. Running the Nexus WAR in Glassfish

There is a known logging configuration conflict between the Nexus Open Source WAR and Glassfish. To address this conflict, you will need to modify the log4j.properties file and change a few of the directives that print messages to the console. The log4j.properties file is located in ~/sonatype-work/conf/log4j.properties. This file is created the first time you attempt to deploy Nexus to Glassfish. To create this file, deploy Nexus to Glassfish. While this initial deployment will fail due to a logging conflict, the act of deploying Nexus to Glassfish will create the working directory in ~/sonatype-work and the log4j.properties file.

Edit this log4j.properties file as follows:

  1. On the first line, change "log4j.rootLogger=INFO, console, logfile" to "log4j.rootLogger=INFO, logfile"

  2. Remove the last three lines starting with "log4j.appender.console"

These changes will instruct Log4J not to print messages to the console. Once you make these edits, restart Glassfish.