上QQ阅读APP看书,第一时间看更新
Installing Jenkins alone on an Apache Tomcat server
If you chose to have an Apache Tomcat server solely for using Jenkins, follow these steps:
- Move to the /tmp directory and download the Jenkins application using the wget command, as shown here:
cd /tmp
wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
- Rename the downloaded jenkins.war package to ROOT.war:
sudo mv jenkins.war ROOT.war
- Next, delete everything inside the /opt/tomcat/webapps directory by switching to the root user:
sudo su -
cd /opt/tomcat/webapps
sudo rm -r *
- Now move the ROOT.war (renamed) package from the /tmp directory to the /opt/tomcat/webapps folder:
sudo mv /tmp/ROOT.war /opt/tomcat/webapps/
- List the contents of the /opt/tomcat/webapps directory and you will notice a ROOT folder automatically gets created:
total 68964 drwxr-x--- 10 root root 4096 Jul 31 23:10 ROOT -rw-rw-r-- 1 ubuntu ubuntu 70613578 Jul 19 22:37 ROOT.war
It's always recommended to have a dedicated web server solely for Jenkins.
- You can access Jenkins by using http://<IP address of Tomcat server>:8080/ without any additional path. Apparently, the Apache server is now a Jenkins server.
Deleting the content of the /opt/tomcat/webapps directory (leaving behind the ROOT directory and ROOT.war) and then moving the jenkins.war file to the webapps folder is also sufficient to make Apache Tomcat server solely for the use of Jenkins.
The step of renaming jenkins.war to ROOT.war is only necessary if you want to make http://<IP address of Tomcat server>:8080/ the standard URL for Jenkins.