Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Tomcat under CentOS system

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about how to install Tomcat under the CentOS system. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1. Check java version information

# java-versionjava version "1.7.0y65" openjdk runtime environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17) openjdk 64-bit server vm (build 24.65-b04, mixed mode)

If not, install jdk

1.1. (the following methods are strongly not recommended, because sometimes the jar package is missing and the tomcat startup is not successful):

Yum-y install java-1.7.0-openjdk

1.2.It is strongly recommended to install the jdk package of oracle, where jdk7 is installed

Download: jdk-7u79-linux-x64.tar.gz to / tmp

Decompress: tar xzf jdk-7u79-linux-x64.tar.gz

Mobile: mv jdk1.7.0_79 / usr/local/java

Add the environment variable vim / etc/profile, at the end of the file:

Export java_home=/usr/local/javaexport classpath=.:$java_home/jre/lib/rt.jar:$java_home/lib/dt.jar:$java_home/lib/tools.jarexport path=$path:$java_home/bin

Effective immediately: source / etc/profile

two。 Download and extract the tomcat

# cd / tmp# wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.72/bin/apache-tomcat-7.0.72.tar.gz# tar xzf apache-tomcat-7.0.72.tar.gz# mv apache-tomcat-7.0.72 / usr/local/tomcat7

3. Start tomcat

# cd / usr/local/tomcat7#. / bin/startup.sh

If the above command does not work, go to the bin folder and run sh startup.sh

[sample output]

Using catalina_base: / usr/local/tomcat7using catalina_home: / usr/local/tomcat7using catalina_tmpdir: / usr/local/tomcat7/tempusing jre_home: / usr/local/javausing classpath: / usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jartomcat started.

4. Visit http://ip:8080

5. Set up user accounts (can be ignored for the time being)

6. Restart the tomcat service and enter the / usr/local/tomcat7 directory

#. / bin/shutdown.sh #. / bin/startup.sh

If the above command does not work, go to the bin folder and run sh shutdown.sh or sh startup.sh

These are all the contents of the article "how to install Tomcat under CentOS". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report