操做系統: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