CD/home/software
Wget http://www.sonatype.org/downloads/nexus-2.1.2-bundle.tar.gz
tar zxvf nexus-2.1.2-bundle.tar.gz
cp /home/software/nexus-2.1.2/bin/jsw/linux-x86-64/nexus /etc/init.d/nexus
Edit the/etc/init. d/nexus file and add the following variable definitions:
1 nexus_home =/home/nexus/nexus2 platform = linux-x86-643 platform_dir = "$ {nexus_home}/bin/JSW/$ {platform }"Modify the following variables:
1 WRAPPER_CMD="${PLATFORM_DIR}/wrapper"2 WRAPPER_CONF="${PLATFORM_DIR}/../conf/wrapper.conf"3 PIDDIR="${NEXUS_HOME}"Modify the following variables and set the user to root:
1 RUN_AS_USER=root
Run the command to add the Nexus self-starting service
1 # chkconfig –add nexus2 # chkconfig –levels 345 nexus on
Run the following command to start and stop the Nexus service:
1 # service nexus start
2 # service nexus stop
Test: http: localhost: 8081: nexus