校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > Linux系統(tǒng)安裝Tomcat并配置Service啟動關(guān)閉

Linux系統(tǒng)安裝Tomcat并配置Service啟動關(guān)閉

熱門標(biāo)簽:長沙回撥外呼系統(tǒng) 江蘇自動外呼系統(tǒng)一般多少錢 ai電話機器人營銷 400 電話 申請費用 鸚鵡螺號航海地圖標(biāo)注時間 信貸電銷機器人系統(tǒng) 比較穩(wěn)定的外呼系統(tǒng) 云南云電銷機器人招商 山東電信外呼系統(tǒng)靠譜嗎

在Linux系統(tǒng)下配置service啟動和關(guān)閉

1, 通過命令cd /etc/init.d文件夾下

2, 再通過命令 vim tomcat 進入vim編輯界面

3,用過 i鍵 現(xiàn)在把下面代碼貼入編輯界面

shell腳本如下

    #!/bin/bash 
    # This is the init script for starting up the 
    # Jakarta Tomcat server 
    # 
    # chkconfig: 345 91 10 
    # description: Starts and stops the Tomcat daemon. 
    # 
 
    # Source function library. 
    . /etc/rc.d/init.d/functions 
 
    # Get config. 
    . /etc/sysconfig/network 
 
    # Check that networking is up. 
    [ "${NETWORKING}" = "no" ] && exit 0 
 
    export JAVA_HOME=/usr/local/javaweb/jdk1.8.0_192 #自己的jdk安裝目錄
    tomcat_home=/usr/local/tomcat/tomcat #自己的tomcat安裝目錄
    startup=$tomcat_home/bin/startup.sh 
    shutdown=$tomcat_home/bin/shutdown.sh 
 
    start(){ 
      echo -n "Starting Tomcat service:" 
      cd $tomcat_home 
      $startup 
      echo "tomcat is succeessfully started up" 
    } 
 
    stop(){ 
      echo -n "Shutting down tomcat: " 
      cd $tomcat_home 
      $shutdown 
      echo "tomcat is succeessfully shut down." 
    } 
 
    status(){ 
      numproc=`ps -ef | grep catalina | grep -v "grep catalina" | wc -l` 
      if [ $numproc -gt 0 ]; then 
        echo "Tomcat is running..." 
      else 
        echo "Tomcat is stopped..." 
      fi 
    } 
 
    restart(){ 
      stop 
      start 
    }  
    # See how we were called. 
    case "$1" in 
    start) 
      start 
      ;; 
    stop) 
      stop 
      ;; 
    status) 
      status 
      ;; 
    restart) 
      restart 
      ;; 
    *) 
      echo $"Usage: $0 {start|stop|status|restart}" 
      exit 1 
    esac

(文件不能執(zhí)行,請執(zhí)行該命令)給文件添加權(quán)限,使得腳本文件可以執(zhí)行,命令為: chmod 755 /etc/rc.d/init.d/tomcat

4, 將文件加入到服務(wù)隊列中

chkconfig --add tomcat

5,查看tomcat 文件是否加入服務(wù)列表成功

chkconfig --list

6,設(shè)置服務(wù)開機自啟動

chkconfig tomcat on

總結(jié)到此結(jié)束

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

標(biāo)簽:衡陽 澳門 嘉興 烏海 亳州 運城 拉薩 齊齊哈爾

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux系統(tǒng)安裝Tomcat并配置Service啟動關(guān)閉》,本文關(guān)鍵詞  Linux,系統(tǒng),安裝,Tomcat,并,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux系統(tǒng)安裝Tomcat并配置Service啟動關(guān)閉》相關(guān)的同類信息!
  • 本頁收集關(guān)于Linux系統(tǒng)安裝Tomcat并配置Service啟動關(guān)閉的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 临沧市| 绥滨县| 盘锦市| 曲周县| 扶余县| 卢湾区| 儋州市| 莱西市| 肃宁县| 思南县| 九寨沟县| 健康| 峨边| 昌宁县| 航空| 五指山市| 汉川市| 甘南县| 灵璧县| 报价| 阆中市| 宁夏| 普格县| 沙雅县| 开封县| 崇礼县| 神木县| 临澧县| 志丹县| 青龙| 江西省| 乌拉特后旗| 宝应县| 三河市| 敦煌市| 隆林| 余江县| 五台县| 惠水县| 红桥区| 原平市|