Unable to access if port number is changed

44 Views Asked by At

The request is to change port number of jenkins site as the default port 8080 is not allowed inside our organization.

Hence I have changed the port to 6052 or 9999 but the site is not accessible , if I change back the default port 8080 or 8088 the site is working ..

Can anyone advise what could be the reason?? Is anything else I should do

I have altered the settings in /etc/sysconfig/jenkins /lib/systemd/system/jenkins.service

2

There are 2 best solutions below

0
Iterokun On

You need to change Jenkins URL setting under Manage Jenkins - System Configuration - System first. Jenkins often runs behind a reverse proxy and can't make assumptions about its url.

0
Dharmik Nakrani On

First open the /etc/default/jenkins file. Then under JENKINS_ARGS section, you can change the port like this

HTTP_PORT=9090.

Then you should restart Jenkins with sudo service jenkins restart.

Then to check the status use this command sudo systemctl status jenkins

1

OPTION 2: open this file /usr/lib/systemd/system/jenkins.service

and put this line

Environment="JENKINS_PORT=8080"