国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Linux服務器 > 正文

詳解在Linux虛擬機下配置tomcat

2024-09-05 23:03:28
字體:
來源:轉載
供稿:網友

1、到Apache官網下載tomcat

http://tomcat.apache.org/download-80.cgi

我下載的是tomcat8

jdk是1.8

如果你們的jdk是1.7或者1.7以下的就下載tomcat6或者tomcat7

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

2、把下載好的tomcat上傳到Linux虛擬機下

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

3、去到tomcat所在的目錄下解壓壓縮包

我的tomcat在/software目錄下

解壓命令:tar xzvf apache-tomcat-8.5

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

解壓好后會多出一個文件

輸入命令:ll

查看目錄

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

接下來可以把我們的壓縮包刪除了

輸入命令:

rm –f apache-tomcat-8.5.9.tar.gz

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

4、去到tomcat下的bin目錄啟動tomcat

輸入命令:

cd apache-tomcat-8.5.9/bin

啟動tomcat命令:

./startup.sh

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

查看所有進程看tomcat是否啟動了

輸入命令:

ps -ef

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

進程太多了,查看不方便的話,我們可以創建一個文本文件保存所有進程

輸入命令:

ps -ef >/software/ps.txt

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

篩選我們想要的進程,例如:我想篩選出帶java的進程

輸入命令:

ps -ef | grep java

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

當我們需要關閉tomcat時

關閉tomcat命令:

./shutdown.sh

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

5、服務器檢查tomcat通不通時,我們需要安裝一個Telnet

輸入命令:

yum install telnet

要確保你的網絡通

輸入y同意安裝

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

安裝完成

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

在Linux虛擬機下測試tomcat通不通,首先要把tomcat啟動先

輸入命令:telnet IP地址 8080

下面是tomcat測試通的情況

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

Tomcat測試不通的情況是這樣的

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

如何查看自己的端口

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

打開server文件查看

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

 6、 客戶端檢查tomcat通不通,也要安裝一個Telnet的客戶端

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

在window系統下調試下IP地址通不通

輸入命令:ping IP地址

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

在window系統下用Telnet命令調試下Linux虛擬機的tomcat通不通

輸入命令:telnet IP地址 8080

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

連接失敗是因為我們Linux有防火墻

這時我們把Linux虛擬機的防火墻關閉就可以了

輸入命令:

systemctl stop firewalld.service

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

Window系統在測試一下能不能連上

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

OK,我們可以連上了

7、我們寫一個JSP頁面調試一下

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

Tomcat的默認目錄是webapps

我們進去看一下

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

里面有五個文件

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

我們把除開ROOT的其他沒必要的文件刪了,ROOT文件是tomcat默認的項目文件。

為了方便,我直接在winscp上把其他文件刪除了,只留下一個ROOT文件

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

我們在window系統用頁面訪問,它會默認跳到ROOT項目,這個項目的首頁就是apache的網站

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

接著把我們剛剛寫好的JSP頁面上傳到ROOT文件里面

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

我們用網頁打開test.jsp

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

我們看下控制臺輸出沒

查看tomcat控制臺,跟蹤日志文件

首先要去到tomcat文件下的logs文件下

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

輸入命令:tail -f  catalina.out

linux,tomcat,配置,linux下配置tomcat,tomcat安裝配置

8、總結

可以看到我們后臺輸出了abc

這樣我們就在Linux虛擬機下配置好我們的tomcat了

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 香河县| 皮山县| 崇礼县| 隆昌县| 武隆县| 鄢陵县| 界首市| 色达县| 墨竹工卡县| 都昌县| 永和县| 濮阳县| 米脂县| 建瓯市| 临汾市| 沧州市| 武平县| 广灵县| 安多县| 宜丰县| 定襄县| 屏南县| 林周县| 达拉特旗| 客服| 林甸县| 潢川县| 三原县| 克拉玛依市| 那曲县| 汉源县| 贡嘎县| 潜江市| 涟源市| 朝阳区| 涡阳县| 牟定县| 车险| 阿坝| 日土县| 衡山县|