
The second command adds nexus as a service to be started and stopped with the service command.Ĭhkconfig manages the symbolic links in /etc/rc.d which control the services to be started and stopped when the operating system restarts or transitions between run-levels. $ tail -f /usr/local/nexus/logs/wrapper.log This script has the appropriate chkconfig directives, so all you need to do is to add the repository manager as a service is run the following commands: $ cd /etc/init.d Run as a Service on Red Hat, Fedora, and CentOS Instead we suggest to follow system administration best practice and use a service specific user with the minimum required access rights only. We recommend to avoid running the repository manager as the root user or a similar privileged user, as this practice poses serious security risks to the host operating system unnecessarily.
If Java is not on the default path for the user running the repository manager, add a JAVA_HOME variable which points to your local Java installation and add a $JAVA_HOME/bin to the PATH. Change the owner and group of the directories used by the repository manager, including nexus-work configured in nexus.properties defaulting to sonatype-work/nexus, to the nexus user that will run the application. For more information about this property and how it would be configured in nf, see. The property you need to add to customize the PID file location is wrapper.pidfile. In most Linux distributions, /var/run is only writable by root.
Change PIDDIR to a directory where this user has read/write permissions. You should not be running the repository manager as root. Set the RUN_AS_USER to nexus or any other user with restricted rights that you want to use to run the service. Change NEXUS_HOME to the absolute folder location (e.g., NEXUS_HOME="/usr/local/nexus").
Edit this script changing the following variables:. Make the /etc/init.d/nexus script executable and owned by the root user - chmod 755 /etc/init.d/nexus Copy $NEXUS_HOME/bin/nexus to /etc/init.d/nexus. Create a nexus user with sufficient access rights to run the service. On a Linux system perform the following operations as the root user: You can configure the repository manager to start automatically by copying the nexus script to the /etc/init.d directory. The following sections provide instructions for configuring the repository manager as a service or daemon on various operating systems. It is good practice to run that service or daemon as a specific user that has only the required access rights. #How to install nexus 2 on a mac pro#
When installing Nexus Repository Manager Pro or Nexus Repository Manager OSS for production usage you should configure it to run as a service, so it starts back up after server reboots.