惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 但用此心

在CentOS中使用 yum 安装MongoDB及服务器端配置 yum安装mongodb 不错的文章 - 但用此心 windows 下,go语言 交叉编译 linux 下 安装go go http 文件下载 - 但用此心 go练习5--生成md5 go练习4--json 序列号反序列化 go练习3 --map的操作 - 但用此心 go练习2-go的学习资料 go练习1-翻转字符串 php 定界符 mysql 修改默认配置 提高性能 eclipse 的代码着色插件 --Eclipse Color Theme 在centos linux上安装jdk7 使用excel 展现数据库内容 java 查看线程死锁 linux 配置 java 环境变量 win7 安装windows 服务 报错 System.Security.SecurityException 解决方法 An exception occurred during the Install phase. System.Security.SecurityException: The so
将tomcat添加为linux系统服务
但用此心 · 2013-08-15 · via 博客园 - 但用此心
(网上找的都不全面,这是结合几个资料整理的,我认为的最简单的将tomcat 添加为系统服务,以及开机自动重启的方法)
1. 首先需要将$Tomcat_HOME/bin目录下的Catalina.sh脚本复制到目录/etc/init.d中,重命名为tomcat,文件名即为以后的服务名
2. 修改刚才复制的tomcat脚本:
  a. 在脚本的第三行后面插入下面两行

  # chkconfig: 2345 10 90
  # description:Tomcat service

  第一行是服务的配置:第一个数字是服务的运行级,2345表明这个服务的运行级是2、3、4和5级(Linux的运行级为0到6);第二个数字是启动优先级,数值从0到99;第三个数是停止优先级,数值也是从0到99。
  第二行是对服务的描述

b. 在脚本中设置 CATALINA_HOME 和 JAVA_HOME 这两个脚本必需的环境变量,如:

    CATALINA_HOME=/usr/share/tomcat
    JAVA_HOME=/usr/share/java/jdk

经过实验发现,即使在系统中设置了这两个环境变量也没有用,只好在这里再设置一遍
c. 添加tomcat 脚本为可执行权限
[root@localhost bin]# chmod 755 /etc/init.d/tomcat

   d. 最后用chkconfig设置服务运行
#chkconfig --add tomcat
服务就添加成功了。
然后你就可以用 chkconfig --list 查看,在服务列表里就会出现自定义的服务了。
注意:
在tomcat文件的头两行的注释语句中,需要包含chkconfig和description两部分内容(确认不要拼写错误,),否则在执行“chkconfig --add tomcat”时,会出现“tomcat服务不支持chkconfig”的错误提示
(注:如果不添加为系统服务,仅是使用service 命令来管理tomcat 的话,a,c ,d 步骤可以省略)
3. OK!现在就可以用service tomcat start|stop|run来管理tomcat服务了

4. 设置tomcat 在操作系统重启后自动重启
直接在/etc/rc.local 后添加下面的语句
/usr/local/tomcat/bin/startup.sh