本文将介紹
Tomcat9.0.37
在
Centos 7
下的安裝使用。
- 在Tomcat官網下載下傳
壓縮包,并上傳到apache-tomcat-9.0.37.tar.gz
檔案夾中Centos /opt

- 使用
指令解壓安裝包tar -zxvf apache-tomcat-9.0.37.tar.gz
- 使用
配置環境變量,并使用vim /etc/profile
指令使配置生效source /etc/profile
shell #Tomcat環境變量配置 export CATALINA_HOME=/opt/apache-tomcat-9.0.37 #這裡是你Tomcat解壓縮路徑
- 進入
檔案夾,編輯con
配置server.xml
字元集,添加UTF-8
URIEncoding="UTF-8"
shell <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/>
- 驗證Tomcat是否安裝成功,進入Tomcat目錄中的bin檔案夾,執行指令./startup.sh ,執行成功如下圖所示