How to install and host Jenkins in Tomcat Server (Windows)
I’m going to explain how to install Jenkins in Tomcat Server.
Below are the pre-requisites:
1. Open JDK-11
2. Apache Tomcat
Below are the steps:
1. Download open JDK-11 from official website.
2. After installing JDK-11, set environment variable and paths for JAVA_HOME.
3. Check version of java installed by using the following command
Note: If java is not recognized as internal/external command, check for the paths set up under windows>set environment variables.
4. Install Apache Tomcat from official website, check for tomcat version compatible with JDK-11. (latest version is preferrable)
5. During installation, make sure port number is not occupied by any other service by using below command
netstat -antup | grep 8080
8080 -> port number
Note : Port number can be customized later by modifying server.xml
Path : C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\conf\server.xml
Snippet that contains port number in server.xml:
<Connector port=”8080" protocol=”HTTP/1.1"
7. Check if tomcat is installed as service by using windows+search for services
8. Download jenkins.war file from Jenkins official website.
9. Go to services, stop tomcat services.
10. Place the jenkins.war in webapps folder
Path : C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps
11. Run java -jar jenkins.war for the first time. The jenkins home directory will be set as following path
12. Start the tomcat service.
13. Run tomcat website : http://localhost:8080, if port number is different, re-modify the port number in URL.
14. Go to manager app, enter the credentials which were provided during setup.
15. You should be able to see jenkins in manager app
16. Click on jenkins link and you will be re-directed to jenkins login page
Note: If you don’t get login page and you get jenkins installation page, please do all the initial setup and install necessary plugins.
Jenkins is successfully setup in Tomcat server!