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. Continue reading

What is Jenkins, Install Jenkins and Fundamental Concepts

What is Jenkins, Install Jenkins and Jenkins Overview

Jenkins for Beginners

In this tutorial i will show you how to install Jenkins, configure it with Tomcat,  do Apache configuration to run it on port 80, secure Jenkins and add users.

What is Jenkins

Jenkins is one of the tools for continuous integration and deployment. You can use Jenkins for  repetitive tasks and even for scheduled jobs. Continue reading

Run Jenkins on port 80 Using Direct URL

Run Jenkins on Port 80

Configure Jenkins on Port 80

Run Jenkins on Port 80
Configure Jenkins to run on port 80 can be done in different ways, today i will be sharing how i figured out running it using proxy reverse using apache.
This method was tested on below configuration:
Red Hat Enterprise Linux Server release 5.9
Apache/2.2.3
Jenkins 2.46

 

First you need to override reverse proxy authorization by adding below rules to either the main httpd.conf or a proxy.conf inside the conf.d folder. (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)

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

Edit /etc/sysconfig/jenkins by adding the following arguments at the end of the file:

JENKINS_ARGS="--prefix=/jenkins

This will specify a folder name that can be accessed through the url in the browser and it's the same like the one we specified earlier in the apache configuration above.

Set the selinux booleans to the below values using following command:

setsebool httpd_can_network_connect true
setsebool httpd_can_network_connect 1

Restart now both jenkins server and httpd, and confirm that jenkins is running with desired configuration and port using below command

ps aux | grep -i jenkins

Test jenkins using the IP.IP.IP.IP:8080, first time you run jenkins it won't ask for any admin passwords.

Edit /etc/sysconfig/jenkins by adding the following arguments at the end of the file, this is what will give your jenkins system access running scripts over the box.

$JENKINS_USER="root"  or any other users which have user access

Below are optional and some user reported that they helped them running jenkins, for me it worked fine without running below permission modifications

chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins

Restart jenkins service one more time.