Tomcat的安裝執行(Linux環境)
阿新 • • 發佈:2022-12-07
Tomcat的安裝執行(Linux環境)
測試環境:
作業系統: CentOS 7.6 x64
Tomcat版本: apache-tomcat-10.0.10
一、Tomcat下載
apache-tomcat-10.0.10下載地址: https://archive.apache.org/dist/tomcat/tomcat-10/v10.0.10/bin/
二、Tomcat執行
下載tomcat到Linux主機指定路徑下,然後解壓檔案包:tar -zxf apache-tomcat-10.0.10-linux_x64.tar.gz
進入 apache-tomcat-10.0.10
目錄下,執行tomcat: bin/startup.sh
三、訪問tomcat
tomcat配置文件中,預設監聽埠為8080。瀏覽器位址列訪問:http://localhost:8080
四、自定義檔案
在 apache-tomcat-10.0.10/webapps/examples
目錄下建立檔案:test.html
test.html內容:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Tomcat 10.0.10</title> </head> <body> <h1> Load Balance Example </h1> <p> There is host A that ip address is 192.168.1.66 </p> </body> </html>
瀏覽器位址列訪問:http://localhost:8080/examples/test.html