1. 下载nexus 私服,exus-latest-bundle.tar.gz
或者使用wget下载
文件,保存到/opt目录下
2. 解压到ubuntu
root@ubuntu:/opt# tar zxvf nexus-latest-bundle.tar.gz
3. 安装jre 环境
可以手动安装,也可以使用openjdk, 这里使用openjdk进行安装
root@ubuntu:/opt# apt-get install openjdk-7-jre-headless
4. 修改nexus文件
root@ubuntu:/opt/nexus-2.6.1-02/bin/jsw/linux-x86-32# vi nexus
添加User = root
# NOTE - This will set the user which is used to run the Wrapper as well as
# the JVM and is not useful in situations where a privileged resource or # port needs to be allocated prior to the user being changed. RUN_AS_USER=root
# Application APP_NAME="nexus" APP_LONG_NAME="Nexus OSS"
5. 启动
root@ubuntu:/opt/nexus-2.6.1-02/bin/jsw/linux-x86-32# ./nexus start
**************************************** WARNING - NOT RECOMMENDED TO RUN AS ROOT **************************************** Starting Nexus OSS... Removed stale pid file: /opt/nexus-2.6.1-02/bin/jsw/linux-x86-32/./nexus.pid Started Nexus OSS.
显示如下这些表示已启动,可以使用命令查看启动方式
root@ubuntu:/opt/nexus-2.6.1-02/bin/jsw/linux-x86-32# ./nexus status **************************************** WARNING - NOT RECOMMENDED TO RUN AS ROOT **************************************** Nexus OSS is running (2470).
6. 通过web 访问nexus私服
http://192.168.248.131:8081/nexus/
一些帮助,和出现问题的解决
1. 不推荐以root 形式登录
WARNING - NOT RECOMMENDED TO RUN AS ROOT
解决方法:
如第四步修改以root方式登录。
2. 如果启动后出现状态一直为未启动,可以查看启动日志
log/wapper.log
valentine@ubuntu:/opt/nexus-2.6.1-02/logs$ tail -f wrapper.log
3. 在日志中如果出现 Unsupported major.minor version 51.0
说明使用了不支持的jre版本。
当前版本需要jre 1.7版本来启动,如果安装1.6版本会出现此问题。
下面是对应版本
J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45