Tomcat Setup

Eduonix Learning Solutions
A free video tutorial from Eduonix Learning Solutions
1+ Million Students Worldwide | 200+ Courses
4.0 instructor rating • 244 courses • 1,198,761 students

Learn more from the full course

Learn DevOps with Jenkins All in One Guide

Be a DevOps Guru and master CI and CD with Jenkins

04:19:29 of on-demand video • Updated December 2018

  • Integrate CI and CD in your development process
  • Learn to use Jenkins for process automation
  • Work on a real world project and implement the concepts
  • Learn professional tips and tricks for better Jenkins management
English Hello everyone. Welcome back. This is a new lecture in your course beginning Jenkins. My name is Ahmed and i work for Eduonix and this is Section 2 of our class. In this lecture we are going to start installing Jenkins through one of the methods that we have explained which is to be part of an Apache Tomcat web server or application server which we call it. We are going to install Jenkins as a war file if you are unfamiliar with the war file It is short for our Web Archive WAR and it contains a number of java jar files. Jar file is again a group of java files that construct an application in its own. So war file is a group of jar files and a jar file is a group of java files and all those in themselves construct an application on its own. So the first step of this installation is to download actually the war file. Lets have a look first at the different installation options for Jenkins. Let's go to Google and search for download Jenkins to go straight to the page where we can download it. OK let's have a look here. We have two methods or two versions. We have long term support or LTS and we have the weekly. The difference between both as you can see here is a weekly where a new release is produced weekly to deliver bug fixes and features to users plugin developers. This is sometimes called Cutting Edge versions. Well this is long term support. This is the more stable if you wish to call it and it has longer support periods. I'm going to choose this one long term support and I'm going to go to generic java package and I'm going to copy this link. Okay. And I've got to go to my vagrant Machine here and i am going to use wget. wget is a command in linux that is used to download files off the Internet. That is exactly what we need to do to download the war file from our from the Jenkins web page and once it is done we're going to start deploying it. So see you once the file gets downloaded. Once the download is finished I have two options. Either to install Jenkins as a servlet on a Tomcat and to enable Tomcat to have more than to have other servlets or to have other applications installed alongside Jenkins. In this case and in order to demonstrate what I mean. Copy Jenkins.war to the default installation of Tomcat. In our case it's at/opt. Of course if you have installed tomcat on your own you will have to have and you will have to have noted where it has been installed. In our case it's by default installed at/opt/Tomcat and installation directory you will have a subdirectory that is called webapps. Just copy Jenkins.war inside that webapps directory. Once done let's have a look at our browser. And let's return back to tomcat. The same page just add a /jenkins like this. In a few moments just the application is starting. Please wait while Jenkins is getting ready to work. The browser will automatically refresh when it is finished. OK. And now it is going to ask you for a password. The password is automatically generated with any new Jenkins installation and this password of course is for securing jenkins because if a default password was given the default password may be a very risky security vulnerability because anybody could have to do it could exploit a default installation Jenkins where the administrators forgot to set the default password. So the hacker can easily get this default password from the Internet or from Jenkins website and use it to access the Jenkins server. So for this reasons Jenkins automatically creates a random very strong password and it saves it in this file by default. It's giving you the path for the file. All that you have to do is just get this file as you can see here this is the password that we need. As you can see here it's very very strong password. Just copy the text as it is this alphanumeric string. Go back to the Jenkins page and paste it and click on Continue. Once done Jenkins is going to start communicating with the server over the internet. Because by default you want to install plugins. Jenkins has a large set of plugins that you can use but we're going to get to that later. So I'm going to close this window. Now Jenkins is ready. You can start using Jenkins. OK. And this is the default page of Jenkins. Congratulations. You have installed Jenkins but as part of Tomcat. This means that you can have other applications installed like say for example I can have a internet banking like for example ibanking application. I can have a calculator for example. Any other application can be hosted inside this Tomcat because this is not the default application. This is not the default Tomcat application. This is just application within Tomcat. Tomcat can host other applications beside this one. Some other people may refer to install Jenkins as the only application on Tomcats. This way Tomcat is going to be dedicated for Jenkins. If you want to do this it's pretty easy. All what you have to do is just remove everything. That is /opt/Tomcat/webapps. Just make sure that you delete everything under webapps. If you forgot to add this / or the * you're going to lead to webapps directory itself. If you want to do this you have to delete everything that is behind this or under this directory. Lets do that And then we are going to copy our Jenkins.war. This time we are going to change its name from Jenkins.war as it was to root.war. This way it is going to lets have a look at the contents of the directory now. I am sorry it should be under webapps. Sorry my fault. Root.War lets delete that file its not all important. Okay. Now let's have a look at the contents of Web apps now. You are going to see that it does have a directory that is called root. Although I have deleted everything under this directory and just copied root.war Or Jenkins.war just renamed it to root.war. But once any war file arrives at this special directory in Tomcat it gets deployed automatically. In our case it got deployed to root and root refers to the default application in Tomcat. Now if we get back to our web browser. Now I would have to lead this Jenkins from my url and just have to localhost:8080 as if I'm heading to the deafult Tomcat page. Only to find it this time I do not have the default page of Tomcat. I have the default page or default log in page of Jenkins. So lets log in and to log in I am going to use the same password that Jenkins has provided for me. Of course you will have to or you can change this password if you want to or you leave it like that. It's up to you. Lets login. And again you are inside Jenkins default page. This time you are a localhost:8080. This is the default page of Tomcat. Tomcat now is dedicated for this application for Jenkins. And that brings us to the end of this lecture. In the coming next lecture we are going to see how we can install Jenkins as a standalone service. We are not going to use Tomcat for our installation. We are not going to even use any applications server whether it was WebSphere, Weblogic, Tomcat, JBoss or any other applications server. We are going to use the other way of installing Jenkins which is to install it using a ready made package one of those. So until next lecture. See you next.