Mac電腦配置Tomcat

下載Tomcat

tomcat.apache.org/download-90…
apache


解壓至Library/apache-tomcat-9.0.8/文件夾下,能夠直接拖動壓縮包到Library目錄,雙擊解壓,刪除壓縮包便可


配置環境變量

終端輸入 vim ~/.bash_profile  若是沒有bash_profile則須要先建立vim

添加Tomcat環境變量配置瀏覽器

#tomcat配置
CATALINA_BASE=/Users/xxx/Library/apache-tomcat-9.0.8
CATALINA_HOME=/Users/xxx/Library/apache-tomcat-9.0.8
export PATH=$PATH:/Users/xxx/Library/apache-tomcat-9.0.8/bin
export CATALINA_BASE CATALINA_HOME
複製代碼


運行Tomcat

須要進入Tomcat下的bin目錄進行運行,即便配置了環境變量仍然會報一下錯誤tomcat

xxxxxx@bogon:~|⇒  sh startup.sh
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
xxxxxx@bogon:~|⇒
複製代碼

終端進入/Users/xxx/Library/apache-tomcat-9.0.8/bin目錄,輸入sh startup.sh啓動Tomcatbash


此時在瀏覽器中輸入 http://loacalhost:8080ui


關閉Tomcat

終端 xxx/bin 目錄下,輸入sh shutdown.sh 關閉Tomcatthis

相關文章
相關標籤/搜索