Jenkins Beginner Tutorial 2 - How to setup Jenkins on Tomcat

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this series on Jenkins beginner tutorial so this is the second session in this series and today we are going to see how to set up Jenkins on top get in the first session we have already seen how do you get started with Jenkins and we also started Jenkins in a standalone server and today we are going to see how we can start it on Tomcat so before we begin a very basic question why should we deploy Jenkins on Tomcat because we can start Jenkins on its own standalone server and Jenkins comes by default with its own servlet container which is a jetty and winstone and we can also start and deploy Jenkins on other sublet containers like Tomcat so why exactly do we need it and what is the difference between running Jenkins standalone which is its default or jetty sublet container versus running Jenkins on Tomcat or any other solid container so one of the benefits of running it on Tomcat is that you can start all your applications on a single server so mostly we have most of our web application in other applications installed on a common server like Tomcat so if you want that human Jenkins should be there we can install and we can deploy Jenkins on Tomcat ok but this is not an essay this is not unnecessary thing if you want to continue with Jenkins standalone you can continue with it but if you want to learn how to we can do it on Tomcat then we can go ahead with this session and these are different kind of servlet containers where we can deploy genkan so it's not just Tomcat we have GlassFish tables and so many others right so we can deploy Jenkins on any of these sublet containers we are using Tomcat here because Tomcat is one of the most common used servlet containers ok so let us begin and as if we requisite we will lead Tomcat 5 or above okay for Jenkins and other thing is you should be having Java on your system and Java 7 or above should be available on your system ok and in case you have any issues with checking the version of Java or if you want to install Java then you can look at this tutorial I had created some time back on how to install Java on windows step-by-step so you can get help from here ok so let us begin and what is step one is download Tomcat and we will be downloading Tomcat zip file right so just go to your browser and go to Tomcat the very first option I am getting is Apache Tomcat let's go here and in the download section you can see I can download any version of Tomcat here let me just select on get it and if you go to the binary distributions you can click on the zip file so it will start downloading Tomcat I will cancel this for now as I already have Tomcat on my system so after you have downloaded what you have to do is unzip and place Tomcat folder at any location on your system ok so you care you have to unzip and you can place it at any location and in my case I have placed it inside tools so this is the Tomcat folder which I have unzipped and kept it here and you might be getting a name like Tomcat and with some version appended in the name of the folder so it is your wish if you want to rename it and change the name to something smaller like I have done only Tomcat you can do that or if you want to keep the entire name as it is that is also fine so I have unzipped and capped it at some location on my system okay so step three is we have to copy and place the Jenkins dot war file inside tomcat web apps folder okay so we had our Jenkins I had placed it here so I will copy it from here and I will go to my tomcat web apps and I will just paste it here so I have pasted it in my tomcat web apps folder okay so now step four is I have to start Tom get so before I start Tomcat what I have to go do is I have to go to command prompt in case of Windows ok or I have to go to terminal if I am on a Mac okay so as of now I am on a Mac so I will go to terminal but if you are on Windows do not worry you just have to follow the same steps on the command prompt okay and here what I have to do is I have to go to Tomcat bin directory okay so I will just navigate to where my Tomcat business so its users desktop tools Tomcat bin okay and then what I have to do is make all files executable okay what does this mean is I will just tell you what I have to do is I have to say chmod plus x star dot Sh okay so if I look into my Tomcat bin directory I have a lot of files and there are some SH files as well all these are executable files so what I need to do is I have to make all these executable all these files as executable write all the SH files as executable so I will use this command chmod is for changing the permissions and I will say + X is for making it executable and I am saying any file with the extension SH should be made executable ok so now I have made all the files as executable ok now I have to start Tomcat so we have to start Tomcat server and the command for that is startup dot SH so if I go to this bin directory I will find there is a startup dot Sh ok so I just have to run this and for shutting down Tomcat I have to run shut down dot SHP so I will just say startup dot SH and remember you should be inside the bin folder if you are outside the bin folder then you have to start with a bin here ok you have to first say bin and then start a broader search but because I am already inside the bin folder I will just say startup dot SH and it is saying Tom get started ok so now we have to verify write verify if Tom get started ok and to do that we have to go to our browser and we have to go to localhost and the default port on which Tomcat starts is 8080 so I will just go to my browser and I will say localhost and 8080 and yes if you see this screen with Apache Tomcat that means your Tomcat is up and running ok and but where is our Jenkins we had put our jenkins inside our WebEx folder right we have Jenkins here Jenkins wot wot so what I will do is I will say slash Jenkins and it is will ask for me for the password so you remember in the last session we have saved our admin password as well so I have saved it here I will just give this password and login and yes now I can see my Jenkins and now my Jenkins is not running as a standalone application it is running inside Tomcat server okay so we also have to verify if Jenkins is running on Tomcat and for that we have to go to the same location and Jenkins okay so this is how we can install we can deploy Jenkins on Tomcat and his interesting thing see now this is the same Jenkins that I had started earlier standalone and now it is on Tomcat so suppose I want to start the standalone Jenkins as well so what I need to do is as we looked into the last session for that we have to go to our Jenkins folder so wherever we have our Jenkins it's inside desktop tools Jenkins and I have to say Java - er Jenkins dot war okay but uh Jenkins also starts by default on port 8080 and we already have our Tomcat running on port 8080 now I cannot start Jenkins standalone on the same port because it is already being used by Tomcat so in that case what I will do is I will say - - HTTP port and now I can give any other port as well let me give 1990 and I will start my Jenkins standalone okay so here is to start Jenkins standalone on a different port then 80 80 which is the default port you have to say Java - jar Jenkins dot war and - - so there is no space between these two hyphens I am just putting it here because it will otherwise make it a single string HTTP port and whatever the port number you want okay so now let us see if I go to my local host nine one nine one port okay it's nine zero nine zero so I can see it is now here so the same Jenkins is running here as well the credentials let me copy it again see I have used the same credentials and now see Jenkins is running on Tomcat on port 8080 and the same Jenkins's running on standalone 9090 port so one more thing that we can you know do to verify that it's the same Jenkins's let me create our test job here and give it as test job one okay now see let me just save this this test job one I have created on the standalone Jenkins on port 1990 and here on port 8080 on the Tomcat I again create some test job too and just to verify and I will save it first okay and now it's see desktop to is created on Tomcat and test job one is created on the standalone Jenkins server let okay let me restart both the servers so I am pressing ctrl C and starting Jenkins on 9090 standalone again and I am also a shutting down Tomcat so again to a shutdown prompt it you have to go to bin and the same this command will be shut down dot Sh okay so I am shutting down Tomcat and I will start it again okay now let us go and refresh both the browsers 9090 as well as the tomcatting deity okay let me go to Jenkins okay now see on Tomcat we had created test job - and tester one was created on the Jenkins standalone server but now we are getting both the jobs here okay and again if I go here again I can see both the jobs okay so that means we are now able to use our Jenkins as standalone as well s inside Tomcat okay so this was all about how to setup Jenkins on Tomcat hope you like it thank you
Info
Channel: Automation Step by Step
Views: 467,881
Rating: undefined out of 5
Keywords: jenkins, jenkins.war, jenkins beginner, jenkins beginner tutorial, How to setup Jenkins on Tomcat, Jenkins Beginner Tutorial 2 - How to setup Jenkins on Tomcat, jenkins basics, learn jenkins, jenkins tomcat, jenkins on tomcat, how to install jenkins on tomcat, tomcat jenkins, jenkins with tomcat, jenkins port, start jenkins, jenkins introduction, jenkins server, jenkins servlet container, jetty, winstone, jenkins jobs, jenkins step by step for beginners
Id: Fi9pgrMlQZY
Channel Id: undefined
Length: 15min 38sec (938 seconds)
Published: Wed Aug 31 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.