1.mkdir /usr/local/nexus,cd /usr/local/nexus
2.wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.13.0-01-bundle.tar.gz下載安裝包?
3.tar -zxvf nexus-2.13.0-01-bundle.tar.gz 解壓文件,并進(jìn)入文件夾
4.進(jìn)到bin目錄 vi nexus,加上一句 NEXUS_HOME="/home/nexus/nexus-2.13.0-01" 修改Jetty的配置渊抄。
再增加運(yùn)行權(quán)限 RUN_AS_USER=root 保存退出
5.設(shè)置開機(jī)啟動
[root@localhost bin]# cp ./nexus /etc/rc.d/init.d/
[root@localhost bin]# cd /etc/rc.d/init.d/
[root@localhost init.d]# chkconfig --add nexus
[root@localhost init.d]# chkconfig --list | grep nexus
nexus ? ? ? ? ? 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost init.d]# chkconfig nexus on
[root@localhost init.d]# chkconfig --list | grep nexus
nexus ? ? ? ? ? 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost init.d]#
6.啟動Nexus
[root@localhost init.d]# cd /usr/local/nexus/nexus-2.13.0-01/bin/
[root@localhost bin]# ./nexus start#啟動nexus
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.
7.增加防火墻端口開放
[root@Florentino init.d]# firewall-cmd --zone=public --add-port=8081/tcp --permanent
success
[root@Florentino init.d]# firewall-cmd --reload
success
收工!