linux安装nexus(支持jdk1.7)并设置开机启动
2017-08-01 17:39
549 查看
版本:nexus-2.6.4-02-bundle
这个版本jdk需要1.7或以上
注:nexus 2.6版本之后不再支持jdk1.6
nexus 2.5.x nexus最后一个支持jdk1.6版本的
1创建安装目录
2上传文件
3解压缩
4为了方便更新和切换版本,创建链接,更新或者切换版本只需更新链接即可:
5 修改配置文件
6 配置用户
7若有设置防火墙,需前往修改防火墙配置并重启防火墙
centos7.3关闭防火墙
关闭firewall:
8 启动nexus
9在浏览器打开:http://ip:8081/nexus,登录:用户名admin 默认密码:admin123
10
11
12
设置开机启动
1、
进入到/etc/init.d目录下,新建一个nexus脚本
cd /etc/init.d
vi nexus
内容
2
给脚本添加执行权限
3 添加系统服务
4.查看开机自启的服务中是否已经有我们的nexus
这个版本jdk需要1.7或以上
注:nexus 2.6版本之后不再支持jdk1.6
nexus 2.5.x nexus最后一个支持jdk1.6版本的
1创建安装目录
[root@xiniu maven]# mkdir -p /usr/java/nexus
2上传文件
3解压缩
[root@xiniu nexus]# ls nexus-2.6.4-02-bundle.zip [root@xiniu nexus]# unzip nexus-2.6.4-02-bundle.zip
4为了方便更新和切换版本,创建链接,更新或者切换版本只需更新链接即可:
[root@xiniu nexus]# ln -s nexus-2.6.4-02 nexus
5 修改配置文件
[root@xiniu bin]# cd /usr/java/nexus/nexus/conf [root@xiniu conf]# ls examples jetty.xml logback.xml nexus.properties [root@xiniu conf]# vi nexus.properties 修改内容 #Jetty section application-port=8081 ##修改Jetty端口号 # nexus section nexus-work=${bundleBasedir}/../sonatype-work/nexus
6 配置用户
[root@xiniu conf]# vi /usr/java/nexus/nexus/bin/nexus 使用/查询字符串 ,使用n查询下一个 修改内容 #RUN_AS_USER= RUN_AS_USER=root
7若有设置防火墙,需前往修改防火墙配置并重启防火墙
centos7.3关闭防火墙
关闭firewall:
systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running) [root@xiniu ~]# systemctl stop firewalld.service [root@xiniu ~]# systemctl disable firewalld.service Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service. [root@xiniu ~]# firewall-cmd --state not running
8 启动nexus
[root@xiniu /]# cd /usr/java/nexus/nexus/bin [root@xiniu bin]# ./nexus start **************************************** WARNING - NOT RECOMMENDED TO RUN AS ROOT **************************************** Starting Nexus OSS... Started Nexus OSS.
9在浏览器打开:http://ip:8081/nexus,登录:用户名admin 默认密码:admin123
10
11
12
设置开机启动
1、
进入到/etc/init.d目录下,新建一个nexus脚本
cd /etc/init.d
vi nexus
内容
#!/bin/bash #chkconfig:2345 20 90 #description:nexus #processname:nexus export JAVA_HOME=/usr/java/jdk1.7.0_79 case $1 in start) su root /usr/java/nexus/nexus/bin/nexus start;; stop) su root /usr/java/nexus/nexus/bin/nexus stop;; status) su root /usr/java/nexus/nexus/bin/nexus status;; restart) su root /usr/java/nexus/nexus/bin/nexus restart;; dump ) su root /usr/java/nexus/nexus/bin/nexus dump ;; console ) su root /usr/java/nexus/nexus/bin/nexus console ;; *) echo "require console | start | stop | restart | status | dump " ;; esac
2
给脚本添加执行权限
chmod +x nexus
3 添加系统服务
#chkconfig --add nexus #chkconfig --levels 345 nexus on
4.查看开机自启的服务中是否已经有我们的nexus
[root@localhost init.d]# chkconfig --list nexus Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. nexus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
相关文章推荐
- CentOS7,安装Tomcat8.5、JDK1.8,并设置开机启动(Linux CentOS Tomcat、JDK+Tomcat、Tomcat开机自启动)
- CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤
- Linux之CentOS--安装Tomcat详解以及设置Tomcat开机启动
- linux下将编译安装的服务设置为开机启动
- 本地安装jdk1.7后,由于Myeclipse使用默认的1.6,如何设置工程支持jdk1.7
- Linux上安装ZooKeeper并设置开机启动(CentOS7+ZooKeeper3.4.10)
- linux安装mongodb(设置非root用户和开机启动)
- CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤
- Linux上安装ZooKeeper并设置开机启动(CentOS7+ZooKeeper3.4.10)
- Linux安装中文输入法并设置开机启动
- linux下安装SVN 并设置开机自动启动
- 安装最后一步:linux设置oracle数据库和监听开机自动启动
- linux系统安装Tomcat并设置开机启动
- linux下一键安装redis并设置为后台进程及开机启动
- CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤
- Linux中安装多个Tomcat并设置开机启动
- linux【centos 】 安装tomcat并设置成开机启动
- linux 下安装jdk、tomcat并开机启动
- Linux上安装ZooKeeper并设置开机启动(CentOS7+ZooKeeper3.4.10)