第一步:

vim /lib/systemd/system/tomcat.service

[Unit]
Description=tomcat
After=network.target [Service]
Type=oneshot
ExecStart=/mnt/app/tomcat-zhidu/bin/startup.sh //自已的tomcat目录
ExecStop=/mnt/app/tomcat-zhidu/bin/shutdown.sh
ExecReload=/bin/kill -s HUP $MAINPID
RemainAfterExit=yes [Install]
WantedBy=multi-user.target

(2).设置权限

chmod 754 tomcat.service

(3).启动关闭服务,设置开机启动

#启动服务
systemctl start tomcat.service
#关闭服务
systemctl stop tomcat.service
#开机启动
systemctl enable tomcat.service

  

centos7 tomcat自启动的更多相关文章

  1. 腾讯云服务器centos 6.5(jdk+tomcat+vsftp)、腾讯mysql数据库 及 tomcat自启动 配置教程

    1.腾讯云数据库配置 1.考虑到安全性问题,,平常不使用root用户登录,新增一个用户名neil,用来管理项目的数据库 a.首先登录root创建db_AA数据库 b.在root用户下,创建neil用户 ...

  2. CentOS7 Tomcat安装

    CentOS7 Tomcat安装 CentOS7 Tomcat安装 Download 从Tomcat下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文件到/ ...

  3. ubuntu16.04设置tomcat自启动

    我的tomcat名字叫tomcat8_product 1.拷贝catalina.sh到/etc/init.d/目录下 cd tomcat8_product/bin/catalina.sh /etc/i ...

  4. CentOS7 Tomcat 启动过程很慢,JVM上的随机数与熵池策略

    1. CentOS7 Tomcat 启动过程很慢 在centos启动官方的tomcat时,启动过程很慢,需要几分钟,经过查看日志,发现耗时在这里:是session引起的随机数问题导致的: <co ...

  5. centos7 tomcat service 自启动

    第一步: vim /lib/systemd/system/tomcat.service 第二步:复制以下代码保存退出,注意修改你的tomcat路径 [Unit] Description=tomcat ...

  6. centOS7 tomcat 开机自启 自启动设置

    1.编写配置文件 // (1)修改tomcat.service vim /lib/systemd/system/tomcat.service // (2)复制以下代码,注意修改tomcat路径 [Un ...

  7. centos7 设置tomcat自启动

    1 .vi  /etc/init.d/tomcat8 #!/bin/bash # # tomcat startup script for the Tomcat server # # chkconfig ...

  8. 阿里云centos 7 中tomcat 自启动

    这里我的tomcat的安装路径为 /usr/local/tomcat 1 为tomcat添加自启动参数 catalina.sh在执行的时候会调用同级路径下的setenv.sh来设置额外的环境变量,因此 ...

  9. Linux系统下设置Tomcat自启动

    需要将tomcat加入自启动队列中,则需要进行如下的操作: 以root用户登录系统: cd /etc/rc.d/init.d/ vi tomcat 文件内容参考如下: #!/bin/sh # # to ...

随机推荐

  1. html页面中的title设置为空格

    这样页面加载时,title会显示为空,而不是当前页面的URL. document.title='\u200E'  

  2. 广播多路访问链路上的OSPF

    实验要求:配置OSPF 拓扑如下: 配置如下: R1 enableconfigure terminal interface l0ip address 192.168.10.1 255.255.255. ...

  3. RESTful Service API 常见问题解决方案

    REST 风格的优秀设计应该像下面这些: - GET /users 获取所有用户 - GET /users/1234 获取ID为1234的用户 - POST /users 创建一个新用户 - PUT ...

  4. socket 映射服务器--(可处理多客户端连接(fork),显示退出信息)

    server #include <stdio.h> #include <sys/types.h> /* See NOTES */ #include <sys/socket ...

  5. Spring Boot 揭秘与实战 附录 - Spring Boot 公共配置

    Spring Boot 公共配置,配置 application.properties/application.yml 文件中. 摘自:http://docs.spring.io/spring-boot ...

  6. 创建一个版本库,把文件夹用Git管理起来

    创建一个文件夹,把这个文件夹用Git管理起来,那么这个文件夹的改变都可以被Git跟踪到,当然也可以将Git中的文件还原到某一个时刻. 首先创建一个空的目录,然后将空的目录由Git来管理 1.建立一个文 ...

  7. [LeetCode&Python] Problem 100. Same Tree

    Given two binary trees, write a function to check if they are the same or not. Two binary trees are ...

  8. 20155219实践题目实现od命令

    实践题目 编写MyOD.c 用myod XXX实现Linux下od -tx -tc XXX的功能 od的功能: od命令用于将指定文件内容以八进制.十进制.十六进制.浮点格式或ASCII编码字符方式显 ...

  9. find 以及linux 和windows 文件互传

    1. find  命令  查找文件或目录 同时也会用到的有 which   whereis   locate   经常也会遇到一些快捷键  ctrl  +  l  e  a  w  u  k     ...

  10. Json工具类JsonUtil

    import com.alibaba.fastjson.JSONArray; import com.fasterxml.jackson.core.JsonProcessingException; im ...