sudo apt-get update
sudo apt install openjdk-8-jre -y
java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
sudo apt install jenkins -y
--
netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
1-2. systemctl status
systemctl status jenkins
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: active (exited) since Mon 2021-02-08 03:24:00 UTC; 43s ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 1140)
CGroup: /system.slice/jenkins.service
Feb 08 03:23:59 ip-172-31-47-24 systemd[1]: Starting LSB: Start Jenkins at boot time...
Feb 08 03:23:59 ip-172-31-47-24 jenkins[16659]: Correct java version found
Feb 08 03:23:59 ip-172-31-47-24 jenkins[16659]: * Starting Jenkins Automation Server jenkins
Feb 08 03:23:59 ip-172-31-47-24 su[16710]: Successful su for jenkins by root
Feb 08 03:23:59 ip-172-31-47-24 su[16710]: + ??? root:jenkins
Feb 08 03:23:59 ip-172-31-47-24 su[16710]: pam_unix(su:session): session opened for user jenkins by (uid=0)
Feb 08 03:23:59 ip-172-31-47-24 su[16710]: pam_unix(su:session): session closed for user jenkins
Feb 08 03:24:00 ip-172-31-47-24 jenkins[16659]: ...done.
Feb 08 03:24:00 ip-172-31-47-24 systemd[1]: Started LSB: Start Jenkins at boot time.
1-1. /etc/default/jenkins HTTP_PORT 확인
cat /etc/default/jenkins
...
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080
...
1-2. /etc/default/jenkins HTTP_PORT 변경
sudo vi /etc/default/jenkins
...
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT = 9000
...
:wq
sudo service jenkins stop
sudo service jenkins start
sudo service jenkins restart