徐州市建设局网站首页/新型营销方式
点击查看全文
环境:CentOS 6.6 Final、JDK7、Sonatype Nexus、Maven
IP:192.168.4.221
root用户操作
前提:已安装JDK7并配置好了环境变量
1、下载最新版Nexus(本教程使用的是:nexus-2.11.2-03-bundle.tar.gz),下载地址:http://www.sonatype.org/nexus/go/
wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz
2、解压
mkdir nexus
tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus
cd nexus
ls
nexus-2.11.2-03 sonatype-work
(一个nexus服务,一个私有库目录)
3、编辑Nexus的nexus.properties文件,配置端口和work目录信息(保留默认)
cd nexus-2.11.2-03
ls
bin 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}/nexus
nexus-webapp-context-path=/nexus
Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF
4、编辑nexus脚本, 配置RUN_AS_USER参数
vi /root/nexus/nexus-2.11.2-03/bin/nexus
RUN_AS_USER=
改为:
RUN_AS_USER=root
5、防火墙中打开8081端口
vi /etc/sysconfig/iptables
添加:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
保存后重启防火墙
service iptables restart
6、启动nexus
/root/nexus/nexus-2.11.2-03/bin/nexus start
WARNING - NOT RECOMMENDED TO RUN AS ROOT
点击查看全文