环境:CentOS 6.6 Final、JDK7、Sonatype Nexus、MavenIP:192.168.4.221root 用户操作前提:已安装 JDK8 并配置好了环境变量1、下载最新版 Nexus http://www.sonatype.org/nexus/go/# wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz2、解压#mkdir nexus#tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus#cd nexus#lsnexus-2.11.2-03 sonatype-work (一个 nexus 服务,一个私有库目录)3、编辑 Nexus 的 nexus.properties 文件,配置端口和 work 目录信息(保留默认)#cd nexus-2.11.2-03#lsbin conf lib LICENSE.txt logs nexus NOTICE.txt tmp查看目录结构,jetty 运行#cd conf#vi nexus.properties#Jetty section application-port=8081 application-host=0.0.0.0 nexus-webapp=${bundleBasedir}/nexusnexus-webapp-context-path=/nexus#Nexus sectionnexus-work=${bundleBasedir}/../sonatype-work/nexusruntime=${bundleBasedir}/nexus/WEB-INF4、编辑 nexus 脚本, 配置 RUN_AS_USER 参数# vi /root/nexus/nexus-2.11.2-03/bin/nexus#RUN_AS_USER=改为:RUN_AS_USER=root5、防火墙中打开 8081 端口# vi /etc/sysconfig/iptables添加:-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT保存后重启防火墙# service iptables restart6、启动 nexus# /root/nexus/nexus-2.11.2-03/bin/nexus start****************************************WARNING - NOT RECOMMENDED TO RUN AS ROOT****************************************Starting Nexus OSS...Started Nexus OSS.
7、浏览器中打开:
8、登录,默认用户名 admin,默认密码 admin123: