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 set tomcat self-startup for linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "linux how to set tomcat self-startup", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "linux how to set tomcat self-startup" article.

Linux sets tomcat to start automatically under centos, and automatically executes the commands in / etc/rc.local after boot. Normally, the command to start tomcat is tomcat_home/bin/startup.sh or tomcat_home/bin/catalina.sh start. When any one of them is directly added to / etc/rc.local, it is found that tomcat is not started after rebooting the machine. The reason is that the java environment has not been set up when booting, so write a script by yourself. Set the java environment first, and then start it. The script is as follows:

The copy code is as follows:

Export java_home=/usr/local/jdk1.6.0_30

Export path=$java_home/bin/:$path

Export classpath=.:$java_home/lib/dt.jar:$java_home/lib/tools.jar:$classpath

Export catalina_home=/usr/local/tomcat-6.0.35/

/ usr/local/tomcat-6.0.35/bin/catalina.sh start

Suppose you save it as a file called auto-startup.sh and store it under / usr/local/tomcat-6.0.35/bin, and then add / usr/local/tomcat-6.0.35/bin/auto-startup.sh to / etc/rc.local. Note: it is necessary to set auto-startup.sh to have execute permission.

The above is about the content of this article on "how to set up tomcat self-startup in linux". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please 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.

Share To

Development

Wechat

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

12
Report