1.下载nexus安装包,下载地址
2.上传/usr/local后解压文件,目录结构如下:
偷懒,直接把解压后的sonatype-work文件移动nexus目录下
3.添加nexus组和用户
groupadd nexus
useradd -g nexus -m nexus
passwd nexus
密码设置为nexus123
4.修改nexus目录归属权限
chown -R nexus:nexus nexus
5.开放防火墙,默认是8081端口
firewall-cmd --zone=public --permanent --add-port=8081/tcp
service firewalld restart
6.修改nexus配置(/usr/local/nexus/conf/nexus.properties),修改nexus的host和工作目录
7.启动nexus
切换到nexus用户,进入目录/usr/local/nexus/bin,执行如下命令启动service:
./nexus start
8.查看启动日志
tail -f ../logs/wrapper.log
a.拷贝文件
$NEXUS_HOME/bin/nexus to /etc/init.d/nexus
b给文件赋执行权限,并分配给root用户
chmod 755 /etc/init.d/nexus
chown root /etc/init.d/nexus
c修改nexus文件(/etc/init.d/nexus)
修改NEXUS_HOME为绝对路径:NEXUS_HOME="/usr/local/nexus"
修改RUN_AS_USER运行用户为nexus
d.添加nexus为启动服务
cd /etc/init.d
$ chkconfig--add nexus
$ chkconfig--levels 345nexus on
$ service nexus start
Starting Nexus Repository Manager Pro...
$ tail-f /usr/local/nexus/logs/wrapper.log
10.在浏览器中访问私服管理界面: