Repository Management with Nexus

3.5. Running Nexus

When you start Nexus, you are starting a web server on the default port 0.0.0.0:8081. Nexus runs within a servlet container called Eclipse Jetty, and it is started with a native service wrapper called the Tanuki Java Service Wrapper. This service wrapper can be configured to run Nexus as a Windows service or a Unix daemon. Nexus ships with generic startup scripts for Unix-like platforms called nexus and for Windows platforms called nexus.bat in the $NEXUS_HOME/bin folder. To start Nexus on a Unix-like platform like Linux, MacOSX or Solaris use

cd /usr/local/nexus
./bin/nexus console

Similarly, starting on Windows can be done with the nexus.bat file. Starting Nexus with the console command will leave Nexus running in the current shell and display the log output.

On Unix systems, you can start Nexus detached from the starting shell with the start command even when not yet installed as a service.

./bin/nexus start

When executed you should see a feedback message and then you can follow the startup process viewing the log file logs/wrapper.log changes.

Starting Nexus Repository Manager...
Started Nexus Repository Manager.
$ tail -f logs/wrapper.log

At this point, Nexus will be running and listening on all IP addresses (0.0.0.0) that are configured for the current host on port 8081. To use Nexus, fire up a web browser and type in the URL http://localhost:8081/nexus. You should see the Nexus user interface as displayed in Figure 3.7, “Nexus Application Window”.

While we use localhost throughout this book, you may need to use the IP Loopback Address of 127.0.0.1, the IP address or the DNS hostname assigned to the machine running Nexus.

Need more from Nexus?

Download a Pro trial and see what you're missing.

Try Nexus Pro for Free

When first starting Nexus Professional you are presented with a form that allows you to request a trial activation. This page displayed in Figure 3.3, “Nexus Trial Activation Form” contains a link to the license activation screen in Figure 3.4, “Nexus License Activation”.

figs/web/installing-trial-form.png

Figure 3.3. Nexus Trial Activation Form


After submitting the form for your trial activation, you will receive a license key via email that you can use in the license activation screen to activate Nexus Professional. If you already have a license key or license file, you can use the same screen to upload the file and register your license.

figs/web/installing-license-activation.png

Figure 3.4. Nexus License Activation


Once you have agreed to the End User License Agreement you will be directed to the Sonatype Nexus Professional Welcome screen displayed in Figure 3.5, “Sonatype Nexus Professional Welcome Screen”.

figs/web/installing-pro-eval-welcome.png

Figure 3.5. Sonatype Nexus Professional Welcome Screen


Click on the Log In link in the upper right-hand corner of the web page, and you should see the login dialog displayed in Figure 3.6, “Nexus Log In Dialog (default login/password is admin/admin123)”.

[Tip]

The default administrator username and password combination is admin and admin123.

figs/web/installing-nexus-login-dialog.png

Figure 3.6. Nexus Log In Dialog (default login/password is admin/admin123)


When you are logged into your evaluation version of Nexus Professional, you will see some helpful links to the Nexus Pro Evaluation Guide, Sample Projects and the Knowledgebase below the search input on the Welcome screen.

With a full license for Nexus these links will be removed and you will get the Nexus Application Window displayed in Figure 3.7, “Nexus Application Window”.

Nexus Open Source will not need to be activated with a license key and will display a number of links to resources and support on the Welcome screen to logged in users.

figs/web/installing-nexus-default-screen.png

Figure 3.7. Nexus Application Window


The files from Java Service Wrapper used for the start up process can be found in $NEXUS_HOME/bin/jsw and are separated into generic files like the wrapper.conf configuration file in conf and a number of libraries in lib. An optional wrapper.conf include allows you to place further configuration optionally in $NEXUS_HOME/conf/wrapper-override.conf.

The platform-specific directories are available for backwards compatibility with older versions only and should not be used. A full list of directories follows:

$ cd /usr/local/nexus/bin/jsw
$ ls -1
conf
lib
license
linux-ppc-64
linux-x86-32
linux-x86-64
macosx-universal-32
macosx-universal-64
solaris-sparc-32
solaris-sparc-64
solaris-x86-32
windows-x86-32
windows-x86-64

The wrapper.conf file is the central configuration file for the startup of the Jetty servlet container running Nexus on a Java virtual machine and therefore includes configuration for things such as the java command to use, Java memory configuration, logging configuration and other settings documented in the configuration file.

Typical modifications include adapting the maximum memory size to your server hardware and usage requirements e.g. 2000 MB up from the default 768 and other JVM related configurations.

wrapper.java.maxmemory=2000

Additional configuration in the wrapper.conf file includes activation of further Jetty configuration file for monitoring Nexus via JMX or using HTTPS.

[Tip]

The startup script nexus supports the common service commands start, stop, restart, status, console and dump.