Ubuntu 16.04: Install Jenkins with apache2


Table of Contents

1 Install Jenkins

Install openjdk-7-jdk in case of Debian 8 and openjdk-8-jdk in case of Ubuntu 16.04.

#!/bin/shsudo apt-get install -y apache2 openjdk-8-jdkwget -q -O – http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -sudo su -c ‘echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list’sudo apt-get update -ysudo apt-get install -y jenkinssudo su -c ‘echo JENKINS_ARGS=”$JENKINS_ARGS –prefix=$PREFIX” >> /etc/default/jenkins’sudo service jenkins restartsudo su -c ‘cat << EOF > /etc/apache2/mods-enabled/jenkins.confProxyPass /jenkins http://localhost:8080/jenkinsProxyPassReverse /jenkins http://localhost:8080/jenkinsProxyRequests OffAllowEncodedSlashes NoDecode<Proxy http://localhost:8080/jenkins> Order deny,allow Allow from all</Proxy>EOF’sudo a2enmod proxysudo a2enmod proxy_httpsudo service apache2 restart

2 Access to Jenkins

Access to Jenkins with URL as below.

http://[IP address fo server]/jenkins

Jenkins require password authentication. The password is in /var/lib/jenkins/secrets/initialAdminPassword.

0001_Input-Password.png

Install suggested plugin.

0002_Select-Plugin.png

Plugin install will starts.

0003_Install-Plugin.png

Add admin user.

0004_Create-Admin-User.png

Jenkins setting is completed.

0005_Jenkins-is-ready.png

Now you can start jenkins.

0006_Jenkins.png

Android | Linux | SDL - Narrow Escape