Jenkins is one of the most popular open source continuous integration tool. It is written in Java. If you want to read about jenkins before installing it, please do read this link.
Following post illustrates a simple Installation of Jenkins on Amazon Linux EC2 Instance.
Environment Details :
Operating System : Amazon Linux 2013.03.01
AMI-ID : ami-3ffed17a
Security Group Ports : 8080
Installation Steps :
1. Please launch an Amazon Linux instance using Amazon Linux AMI.
2. Login to your Amazon Linux instance.
3. Become root using “sudo su -” command.
4. Update your repositories
# yum update
5. Get Jenkins repository using below command
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
6. Get Jenkins repository key
rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key
7. Install jenkins package
# yum install jenkins
8. Start jenkins and make sure it starts automatically at system startup
# service jenkins start
# chkconfig jenkins on
9. Open your browser and navigate to http://<Elastic-IP>:8080. You will see jenkins dashboard.
That’s it. You have your jenkins setup up and running. Now, you can create jobs to build the code.
Securing Jenkins Setup :
As seen, your above installed jenkins setup is directly accessible through internet and there are no security measures to prevent direct access. In order to secure your jenkins setup, you need to enable some sort-of security authorization on it.
To enable security for jenkins setup, please select “Manage Jenkins” on jenkins dashboard and click on “Configure Global Security”.
After this, please select “Enable Security”.
Jenkins provide different level of security methods like integrating it with your LDAP setup or using Unix user/group database. In our case, we will create “Jenkins’ Own User Database”. So, please select “Jenkins’s Own User Database” under security realm. Don’t forget to select “Allow users to sign up”. Also, select “Matrix-based security” under Authorization.
Now, please add an user (for eg., admin) to jenkins user database by adding username under matrix-based security section.
Once done, please provide necessary privileges to this user. In our case, we make this user as an administrator, so he will have full privileges.
Once done, please click on save. Now, you will be asked to provide username and password for the user to login. But we don’t have any. So, please click on “Create an account”.
Now, please provide your username ( “admin” in our case) and provide necessary details like password, name and email address.
Once done, you will be logged into jenkins and your whole setup is secured.
Now, you can create jenkins jobs without any security issues.
This article was originally posted @ http://sanketdangi.com/post/62715793234/install-configure-jenkins-on-amazon-linux
No comments:
Post a Comment