Change Jenkins Port on Linux and Forward Jenkins to Port 80

Forward Jenkins to Port 80 from Jenkins 8080 port

Changing Jenkins Default Port

Jenkins Video Tutorial

Change Jenkins Port on Linux

In this tutorial i will be showing you how to change Jenkins 8080 to Jenkins 80 / 443 or any other port.

First you have to be sure that Apache HTTPD is installed and running and then open httpd.conf file and use below configuration.

ProxyPass -- Maps remote servers into the local server URL-space.
nocanon -- URL path "raw" to the backend.
ProxyPassReverse -- Adjusts the URL in HTTP response headers sent from a reverse proxied server.
prxyrequests -- Enables forward (standard) proxy requests
AllowEncodedSlashes -- Determines whether encoded path separators in URLs are allowed to be passed through

vi /etc/httpd/conf/httpd.conf

ProxyPass /jenkins http://localhost:8080/jenkins nocanon
ProxyPassReverse /jenkins http://localhost:8080/jenkins
ProxyRequests Off
AllowEncodedSlashes NoDecode

<Proxy http://localhost:8080/jenkins*>
Order deny,allow
Allow from all
</Proxy>

 

Add in the end of file "JENKINS_ARGS="--prefix=/jenkins" which means that this is the name of folder which added in above httpd

vi /etc/sysconfig/jenkins
JENKINS_ARGS="--prefix=/jenkins

If you selinux is enabled then you need to run the below commands:

setsebool httpd_can_network_connect true
setsebool httpd_can_network_connect 1

Restart both Jenkins and Apache services

systemctl restart jenkins
systemctl restart httpd

 

 


Subscribe to
for video tutorials updates