操做系统:CentOS Linux release 7.5.1804 (Core)java
软件版本:nexus-3.16.2-01-unix.tar.gznode
强烈建议阅读官方的「System Requirements」文档。nginx
重点关注:专有帐户;文件句柄数;内存;磁盘文件系统;shell
#!/bin/sh yum install -y java-1.8.0-openjdk.x86_64
#!/bin/sh cd /opt/ wget http://download.sonatype.com/nexus/3/nexus-3.16.2-01-unix.tar.gz tar -xf nexus-3.16.2-01-unix.tar.gz # 解压后会生成两个目录:应用目录;数据目录; # 有关各个目录的做用,参考:https://help.sonatype.com/repomanager3/installation/directories
#!/bin/sh ################################################################################ # 添加用户 # 一般是名为nexus的用户,而且必须能够建立一个可用的shell ################################################################################ useradd nexus ################################################################################ # 启动服务 ################################################################################ bin/nexus run # 当显示「Started Sonatype Nexus OSS」时,表示启动成功。 # 若是要中止服务,能够Ctrl+C来中止 # 也能够经过start, stop, restart, force-reload, status等命令来管理 ################################################################################ # 访问服务 ################################################################################ # 打开浏览器,默认监听的端口号是8081,即访问http://localhost:8081/便可。 # 默认的用户名:amdin;密码:admin123;
详细内容参考官方「Run as a Service」文档。下面是systemd的示例:浏览器
#!/bin/sh cat > /etc/systemd/system/nexus.service <<EOF [Unit] Description=nexus service After=network.target [Service] Type=forking LimitNOFILE=65536 ExecStart=/opt/nexus/nexus/bin/nexus start ExecStop=/opt/nexus/nexus/bin/nexus stop User=nexus Restart=on-abort [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable nexus.service systemctl start nexus.service
详细参考官方「Run Behind a Reverse Proxy」文档。下面是Nginx反向代理的示例:tcp
http { proxy_send_timeout 120; proxy_read_timeout 300; proxy_buffering off; keepalive_timeout 5 5; tcp_nodelay on; server { listen *:80; server_name www.example.com; # allow large uploads of files client_max_body_size 1G; # optimize downloading files larger than 1G #proxy_max_temp_file_size 2G; location / { # Use IPv4 upstream address instead of DNS name to avoid attempts by nginx to use IPv6 DNS lookup proxy_pass http://127.0.0.1:8081/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } }
「Post Install Checklist」ide
System Requirements
Download Archives - Repository Manager 3
Accessing the User Interfaceui