Jenkins version: 2.332.1
Jenkins default port number: 8080
Modify the vim /etc/sysconfig/jenkins configuration file. Modify JENKINS_PORT="7777" :wq. Save the configuration, exit, and restart JenkinsCopy the code
D/Jenkins file start method is executed when service Jenkins start is executed
But !!!!
If the system starts using systemctl
Systemctl Start Jenkins service Jenkins start
Need to modify the configuration file: / usr/lib/systemd/system/Jenkins. Service
Vim/usr/lib/systemd/system/Jenkins. Service Environment = "JENKINS_PORT = 7777" : wq save exit reload services: systemctl daemon - reloadCopy the code
Reboot Jenkins again:
Systemctl start Jenkins or service Jenkins startCopy the code
Jenkins can view ports in status