赞
踩
1. 下载nexus安装包
wget "https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.14.3-02-bundle.tar.gz"
2. 解压安装包:
tar -xfvz nexus-2.14.3-02-bundle.tar.gz
mv nexus-2.14.3-02 /usr/local
解压之后就会看到两个目录:
nexus-2.14.3-02:里面是nexus的运行环境和应用程序。
sonatype-work:里面是我们后面要对nexus进行一些配置的地方,像索引和起始的仓库和端口等都可以在这里面配置。
3. 添加环境变量vim /etc/profile,添加如下两行
export RUN_AS_USER=root
export PATH=.:$JAVA_HOME/bin:$RUN_AS_USER:$PATH
4. 更新环境变量,使其立即生效
source /etc/profile
5.查看配置文件nexus.properties
cat /usr/local/nexus-2.14.3-02/conf/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
# orientdb buffer size in megabytes
storage.diskCache.bufferSize=4096
6. 修改nexus启动用户为root
vim /usr/local/nexus/nexus-2.14.3-02/bin/nexus
修改内容:RUN_AS_USER=root
7. 启动nexus:
/usr/local/nexus-2.14.3-02/bin/nexus start
[root@localhost bin]# ./nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Starting Nexus OSS...
Started Nexus OSS.
8.安装成功后,在浏览器访问:
http://192.168.174.132:8081/nexus
默认账户和密码: admin/admin123
其他基本命令:
/usr/local/nexus-2.14.3-02/bin/nexus start 启动
/usr/local/nexus-2.14.3-02/bin/nexus stop 停止
/usr/local/nexus-2.14.3-02/bin/nexus restart 重启
/usr/local/nexus-2.14.3-02/bin/nexus status 查看状态
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。