-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNexus_Setup_Script
More file actions
31 lines (29 loc) · 805 Bytes
/
Nexus_Setup_Script
File metadata and controls
31 lines (29 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
sudo yum update -y
sudo yum install wget -y
sudo yum install java-17 -y
sudo mkdir /app && cd /app
sudo wget https://download.sonatype.com/nexus/3/nexus-3.89.1-02-linux-x86_64.tar.gz
sudo tar -xvf nexus-3.89.1-02-linux-x86_64.tar.gz
mv nexus-3.89.1-02 nexus
sudo adduser nexus
sudo chown -R nexus:nexus nexus
sudo chown -R nexus:nexus sonatype-work/
echo 'run_as_user="nexus"' | sudo tee -a /app/nexus/bin/nexus.rc
sudo tee /etc/systemd/system/nexus.service > /dev/null <<EOF
[Unit]
Description=Nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/app/nexus/bin/nexus start
ExecStop=/app/nexus/bin/nexus stop
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
sudo chkconfig nexus on
sudo systemctl start nexus
sudo systemctl status nexus