日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 开启关闭tomcat服务器端口,linux系统安装、启动和关闭tomcat

發布時間:2025/3/12 linux 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 开启关闭tomcat服务器端口,linux系统安装、启动和关闭tomcat 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Tomcat 可充當一個完全獨立的 web 服務器。Tomcat 最大優勢在于 servlet 和 JSP 引擎。

安裝 tomcat:

Sudo yum install -y tomcat-*

啟動 tomcat:

[user@localhost ~]$ /etc/rc.d/init.d/tomcat start

[user@localhost ~]$

[user@localhost ~]$ /etc/rc.d/init.d/tomcat status

[user@localhost ~]$

如上所示,啟動過程沒有任何輸出,查看服務狀態也沒有任何輸出,說明服務啟動沒有成功。

為何呢?

想到/etc/rc.d/init.d/tomcat 是 bash 腳本,因此可以對其進行調試,調試方法如下:

[user@localhost ~]$ bash -x /etc/rc.d/init.d/tomcat status

+ '[' -r /lib/lsb/init-functions ']'

+ exit 1

[user@localhost ~]$

由以上輸出可以,問題出在 /lib/lsb/init-functions 文件找不到。好,下面查查該文件屬于哪個 rpm

包。

[user@localhost ~]$ yum whatprovides /lib/lsb/init-functions

已加載插件:langpacks, refresh-packagekit

redhat-lsb-core-4.1-14.fc19.i686 : LSB Core module support

:fedora

匹配來源:

文件名

:/lib/lsb/init-functions

redhat-lsb-core-4.1-14.fc19.x86_64 :源

:fedora

匹配來源:

文件名

:/lib/lsb/init-functions

LSB Core module support

redhat-lsb-core-4.1-15.1.fc19.i686 : LSB Core module support

:updates

匹配來源:

文件名

:/lib/lsb/init-functions

redhat-lsb-core-4.1-15.1.fc19.x86_64 : LSB Core module support

:updates

匹配來源:

文件名

:/lib/lsb/init-functions

哦,原來 tomcat 依賴于包 redhat-lsb-core,但在 tomcat 的 requires 中沒有寫明,坑啊!

下面,把 redhat-lsb-core 裝上看看。

[user@localhost ~]$ sudo yum install -y redhat-lsb-core

已加載插件:langpacks, refresh-packagekit

正在解決依賴關系

--> 正在檢查事務

---> 軟件包 redhat-lsb-core.x86_64.0.4.1-15.1.fc19 將被 安裝

--> 解決依賴關系完成

依賴關系解決

========================================================================

===================================================================

Package

架構

版本

大小

========================================================================

===================================================================

正在安裝:

redhat-lsb-core

x86_64

4.1-15.1.fc19

updates

36 k

事務概要

========================================================================

===================================================================

安裝 1 軟件包

總下載量:36 k

安裝大小:45 k

Downloading packages:

redhat-lsb-core-4.1-15.1.fc19.x86_64.rpm

| 36 kB 00:00:02

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

正 在 安 裝1/1

驗 證 中1/1

已安裝:

redhat-lsb-core.x86_64完畢!

0:4.1-15.1.fc19

redhat-lsb-core-4.1-15.1.fc19.x86_64

redhat-lsb-core-4.1-15.1.fc19.x86_64

再次啟動 tomcat 試試。

[user@localhost ~]$ sudo /etc/rc.d/init.d/tomcat start

Starting tomcat:[ 確定 ]

[user@localhost ~]$

好,啟動成功!

在網頁瀏覽器中輸入http://127.0.0.1:8080/看服務是否運行可以訪問:

關閉tomcat:

[user@localhost ~]$ sudo /etc/rc.d/init.d/tomcat stop

Stopping tomcat:?????????????????????????????????????????? [? 確定? ]

[user@localhost ~]$

至此,安裝、啟動和關閉都順利完成。

總結

以上是生活随笔為你收集整理的linux 开启关闭tomcat服务器端口,linux系统安装、启动和关闭tomcat的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。