您的位置:首页 > 运维架构 > Linux

Linux下使用nexus搭建maven仓库私服

2016-02-22 18:31 615 查看

下载安装

下载地址:http://www.sonatype.org/nexus/archived (目前最新版本是2.12.0-01)
解压后会在同级目录中,出现两个文件夹:
nexus-2.12.0-01
sonatype-work
,前者包含了nexus的运行环境和应用程序,后者包含了你自己的配置和数据。

解压命令:

tar zxvf nexus-2.12.0-01-bundle.tar.gz




启动Nexus

cd /nexus-2.12.0-01/bin
./nexus
Usage: ./nexus { console | start | stop | restart | status | dump }
# ./nexus start
****************************************
If you insist running as root, then set theenvironment variable RUN_AS_USER=root before running this script.
****************************************
Starting Nexus OSS...
Started Nexus OSS.


如果出现 If you insist running as root, then set theenvironment variable RUN_AS_USER=root before running this script.

解决方法

关于这个问题共有两种解决方法,一种是临时解决,一种是永久的解决。
临时解决
export RUN_AS_USER=root
./nexus start


永久方法
vi /etc/profile
添加到文件最后一行
export RUN_AS_USER=root


修改保存即可!

启动nexus即可

cd /nexus-2.12.0-01/bin
./nexus start


Apache 域名代理配置

<VirtualHost *:80>
ServerAdmin 127.0.0.1
DocumentRoot "/mnt/soft/nexus/nexus-2.12.0-01/nexus" ---nexus 安装目录
ServerName 127.0.0.1
ServerName 域名(例如: test.nexus.org)
ProxyPass / http://127.0.0.1:8998/ 8998 为nexus配置端口号
ServerAlias 127.0.0.1
</VirtualHost>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  maven nexus