Nexus is configured to run with a built-in webserver on port 8070 and keeps its data in /var/lib/nexus.
Install and start Nexus
- sudo su -l
- cd /opt
- wget http://nexus.sonatype.org/downloads/nexus-oss-webapp-1.6.0-bundle.tar.gz (or latest: http://www.sonatype.org/nexus/go/)
- tar -zxf nexus-oss-webapp-1.6.0-bundle.tar.gz
- useradd -m -s /bin/bash nexus
- chown -R nexus:nexus nexus-oss-webapp-1.6.0
- ln -s /opt/nexus/bin/jsw/linux-x86-64/nexus /etc/init.d/nexus
- vi /etc/init.d/nexus
- change RUN_AS_USER to nexus
- vi /opt/nexus/conf/plexus.properties
- change application-port to 8070
- change nexus-work to /var/lib/nexus
- change webapp-context-path to /
- mkdir /space/var/lib/nexus
- chown nexus:nexus /space/var/lib/nexus
- ln -s /space/var/lib/nexus /var/lib/nexus
- /etc/init.d/nexus start
- Verify it's running by hitting http://localhost:8070/
Set up m2.duraspace.org vhost
- cd /etc/apache2/sites-available
- add m2.duraspace.org (text)
- a2ensite m2.duraspace.org
- /etc/init.d/apache2 reload
Initial Nexus Configuration
- Login at m2.duraspace.org as "admin", password "admin123" (this is the default)
- You might get an error immediately after logging in. This is because the application url hasn't been set yet.
- Set the application URL: Under Administration, Server, scroll down to Application Server Settings, and enter
- Base URL: https://m2.duraspace.org/
- Force Base URL: Enabled (check it)
- Click save
- Set a new "admin" password: Under Security, Change Password
Migrate m2 repositories from previous host
- On previous host:
- cd /var/lib/nexus/storage
- sudo tar -zcf repos.tgz releases snapshots thirdparty (download repos.tgz)
- Copy to new-host:/var/lib/nexus/storage
- On new host:
- sudo service nexus stop
- cd /var/lib/nexus/storage
- sudo rm -rf releases snapshots thirdparty
- sudo tar -zxf repos.tgz
- sudo rm repos.tgz
- sudo service nexus start
- Login to m2.duraspace.org
- Under Repository, for each repository migrated (releases, snapshots, thirdparty):
- Expire cache
- Rebuild metadata
- Reindex
Auto start/stop
- sudo sysv-rc-conf -p
- Make it start after slapd and apache (S19, S91), and shutdown before slapd and apache (K80, K09)
- Navigate to down to nexus
- Under columns 1, 0, and 6, type K08
- Under columns 2, 3, 4, and 5, type S92