- 下載Tomcat
地址: http://tomcat.apache.org/download-70.cgi
-
將下載的文件放到一個(gè)位置
啟動(dòng)
cuilinhaodeMacBook-Pro:~ cuilinhao$ cd /Users/cuilinhao/Documents/apache-tomcat-7.0.88/bin
然后直接 ./startup.sh
如果出現(xiàn) -bash: ./startup.sh: Permission denied
則命黔,執(zhí)行cuilinhaodeMacBook-Pro:bin cuilinhao$ chmod u+x *.sh 就會(huì)有權(quán)限
再次 ./startup.sh
cuilinhaodeMacBook-Pro:bin cuilinhao$ ./startup.sh
Using CATALINA_BASE: /Users/cuilinhao/Documents/apache-tomcat-7.0.88
Using CATALINA_HOME: /Users/cuilinhao/Documents/apache-tomcat-7.0.88
Using CATALINA_TMPDIR: /Users/cuilinhao/Documents/apache-tomcat-7.0.88/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Using CLASSPATH: /Users/cuilinhao/Documents/apache-tomcat-7.0.88/bin/bootstrap.jar:/Users/cuilinhao/Documents/apache-tomcat-7.0.88/bin/tomcat-juli.jar
Tomcat started.
訪問(wèn):打開(kāi)你的 safari 呜呐,然后網(wǎng)址輸入 http://localhost:8080/
這時(shí),tomac就相當(dāng)于是一個(gè)你自己電腦的服務(wù)器悍募,訪問(wèn)某個(gè)文件蘑辑,
可以直接這樣
http://localhost:8080/tomcat-power.gif
出現(xiàn)下圖
關(guān)閉
$:./shutdown.sh
查看版本
$:sh catalina.sh version