Skip to content

Instantly share code, notes, and snippets.

Last active April 8, 2024 22:42
Show Gist options
  • Save jsuwo/9038610 to your computer and use it in GitHub Desktop.
Save jsuwo/9038610 to your computer and use it in GitHub Desktop.

Continuous Integration with Jenkins on Amazon EC2

Initial Setup

Fixing Locales in Ubuntu 13.04 on Amazon EC2

sudo apt-get install language-pack-en

Installing Jenkins

wget -q -O - | sudo apt-key add -
echo "deb binary/" | sudo tee -a /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins

Installing and Configuring Apache

Installing Apache

sudo apt-get install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http


<VirtualHost *:80>
	ServerName HOSTNAME
	ProxyRequests Off
	<Proxy *>
		Order deny,allow
		Allow from all
	ProxyPreserveHost on
	ProxyPass / http://localhost:8080/

Enabling jenkins.conf

sudo a2ensite jenkins
sudo service apache2 reload

Installing Java / Maven / Git

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer maven git-core
package ca.uwo.csd.cs2212.USERNAME;
public class BankAccount {
private double balance;
public BankAccount(double balance) {
this.balance = balance;
public double debit(double amount) {
if (balance < amount) {
amount = balance;
balance -= amount;
return amount;
package ca.uwo.csd.cs2212.USERNAME;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
public class TestBankAccount {
Copy link

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.096 s
[INFO] Finished at: 2018-03-20T08:59:53+00:00
[INFO] Final Memory: 9M/21M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS

but no test cases ran.... pls help

Copy link

I stopped the instance and restarted it again but when I enter ec2 instance public dns in url page I am unable to access the jenkins page. always showing "Apache2 Ubuntu Default Page" how to reslove this issue.

Copy link

tell me the GITHUB url where all the Maven java project code is stored ??

Copy link

when we try to enter systemctl reload apache2
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to reload 'apache2.service'.
Authenticating as: Ubuntu (ubuntu)
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
because of this I am unable to access the jenkins with "aws ec2 instance name:8080" in my local browser.

can anyone please guide me to resolve this issue

Copy link

bhanuRanosys commented Dec 26, 2019

Err:1 binary/ jenkins ...                               
  Connection failed
E: Failed to fetch  Connection failed

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

If anyone facing the above error. Please use the following commands instead while installing Jenkins:

wget -q -O - | sudo apt-key add -

sudo rm  /etc/apt/sources.list.d/jenkins.list

echo "deb binary/" | sudo tee -a /etc/apt/sources.list.d/jenkins.list

sudo apt-get update

sudo apt-get install jenkins

If you still facing issues while installing Jenkins, you can directly download it from there website:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment