In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to install tomcat in centos. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
1. Download tomcat
I downloaded it on windows and uploaded it to the centos server at the download address: https://tomcat.apache.org/download-80.cgi
The version I downloaded is: apache-tomcat-8.5.43.tar.gz
two。 Decompress tomcat
$cd usr/java/tomcat
[root@43-c59438365-0048-0727982 tomcat] # apache-tomcat-8.5.43.tar.gz
[root@43-c59438365-0048-0727982 tomcat] # tar-zxvf apache-tomcat-8.5.43.tar.gz
[root@43-c59438365-0048-0727982 tomcat] # ll
Total 9512
Drwxr-xr-x 9 root root 4096 Aug 10 12:37 apache-tomcat-8.5.43
-rw-r--r-- 1 root root 9717059 Aug 10 12:35 apache-tomcat-8.5.43.tar.gz
3. Modify the tomcat environment variable
[root@43-c59438365-0048-0727982 apache-tomcat-8.5.43] # cd bin/
[root@43-c59438365-0048-0727982 bin] # pwd
/ usr/java/tomcat/apache-tomcat-8.5.43/bin
[root@43-c59438365-0048-0727982 bin] # ll
Total 872
-rw-r- 1 root root 35183 Jul 5 04:53 bootstrap.jar
-rw-r- 1 root root 15900 Jul 5 04:53 catalina.bat
-rwxr-x--- 1 root root 23447 Jul 5 04:53 catalina.sh
-rw-r- 1 root root 1664 Jul 5 04:56 catalina-tasks.xml
-rw-r- 1 root root 2123 Jul 5 04:53 ciphers.bat
-rwxr-x--- 1 root root 1997 Jul 5 04:53 ciphers.sh
-rw-r- 1 root root 25145 Jul 5 04:53 commons-daemon.jar
-rw-r- 1 root root 207125 Jul 5 04:53 commons-daemon-native.tar.gz
-rw-r- 1 root root 2040 Jul 5 04:53 configtest.bat
-rwxr-x--- 1 root root 1922 Jul 5 04:53 configtest.sh
-rwxr-x--- 1 root root 8513 Jul 5 04:53 daemon.sh
-rw-r- 1 root root 2091 Jul 5 04:53 digest.bat
-rwxr-x--- 1 root root 1965 Jul 5 04:53 digest.sh
-rw-r- 1 root root 3460 Jul 5 04:53 setclasspath.bat
-rwxr-x--- 1 root root 3708 Jul 5 04:53 setclasspath.sh
-rw-r- 1 root root 2020 Jul 5 04:53 shutdown.bat
-rwxr-x--- 1 root root 2234 Aug 10 13:07 shutdown.sh
-rw-r- 1 root root 2022 Jul 5 04:53 startup.bat
-rwxr-x--- 1 root root 2236 Aug 10 13:06 startup.sh
-rw-r- 1 root root 49935 Jul 5 04:53 tomcat-juli.jar
-rw-r- 1 root root 419428 Jul 5 04:53 tomcat-native.tar.gz
-rw-r- 1 root root 4574 Jul 5 04:53 tool-wrapper.bat
-rwxr-x--- 1 root root 5515 Jul 5 04:53 tool-wrapper.sh
-rw-r- 1 root root 0 Aug 10 13:33 velocity.log
-rw-r- 1 root root 2026 Jul 5 04:53 version.bat
-rwxr-x--- 1 root root 1908 Jul 5 04:53 version.sh
[root@43-c59438365-0048-0727982 bin] #
Mainly modify the two files startup.sh and shutdown.sh
Vi is the two files above, plus the following configuration, in which the jdk environment variable is different from that of everyone in the tomcat location
Export JAVA_HOME=/usr/java/jdk/jdk1.8.0_221
Export TOMCAT_HOME=/usr/java/tomcat/apache-tomcat-8.5.43
Export CATALINA_HOME=/usr/java/tomcat/apache-tomcat-8.5.43
Export CLASS_PATH=$JAVA_HOME/bin/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tool.jar
Export PATH=$PATH:/usr/java/jdk/jdk1.8.0_221/bin:/usr/java/tomcat/apache-tomcat-8.5.43/bin
4. Modify tomcat port
[root@43-c59438365-0048-0727982 conf] # pwd
/ usr/java/tomcat/apache-tomcat-8.5.43/conf
[root@43-c59438365-0048-0727982 conf] #
Change 8080 to 8086
5. Start tomcat
[root@43-c59438365-0048-0727982 bin] # pwd
/ usr/java/tomcat/apache-tomcat-8.5.43/bin
[root@43-c59438365-0048-0727982 bin] #. / startup.sh
Tomcat startup result
[root@43-c59438365-0048-0727982 bin] # ps-ef | grep tomcat
Root 5064 13 13:35? 00:01:10 / usr/java/jdk/jdk1.8.0_221/bin/java-Djava.util.logging.config.file=/usr/java/tomcat/apache-tomcat-8.5.43/conf/logging.properties-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djdk.tls.ephemeralDHKeySize=2048-Djava.protocol.handler.pkgs=org.apache.catalina.webresources-Dorg.apache.catalina.security.SecurityListener.UMASK=0027-Dignore.endorsed.dirs=-classpath / usr/ Java/tomcat/apache-tomcat-8.5.43/bin/bootstrap.jar:/usr/java/tomcat/apache-tomcat-8.5.43/bin/tomcat-juli.jar-Dcatalina.base=/usr/java/tomcat/apache-tomcat-8.5.43-Dcatalina.home=/usr/java/tomcat/apache-tomcat-8.5.43-Djava.io.tmpdir=/usr/java/tomcat/apache-tomcat-8.5.43/temp org.apache.catalina.startup.Bootstrap start
Root 5244 4706 0 14:09 pts/1 00:00:00 grep-color=auto tomcat
[root@43-c59438365-0048-0727982 bin] #
6. Visit tomcat
Http://localhost:8086
The familiar tomcat home page will appear.
7. Deploy the war package
Just package the web project into a war package through maven, put it in the webapps directory of tomcat, and visit your project.
Http://localhost:8086/ your project name
The above is how to install tomcat in the centos shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Configure DHCP server on Cisco Router:--ip dhcp excluded-addres
© 2024 shulou.com SLNews company. All rights reserved.