1.下载zip包: http://tomcat.apache.org/download-70.cgi
2.添加环境变量
vim ~/.bash_profile 添加
export PATH=$PATH:/Users/wxm/java/apache-tomcat-7.0.82/bin
生效配置:
source ~/.bash_profile
3.提权
chmod 0755 /Users/wxm/java/apache-tomcat-7.0.82/bin/*.sh
4.启动服务:
sh startup.sh
Using CATALINA_BASE: /Users/wxm/java/apache-tomcat-7.0.82
Using CATALINA_HOME: /Users/wxm/java/apache-tomcat-7.0.82
Using CATALINA_TMPDIR: /Users/wxm/java/apache-tomcat-7.0.82/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
Using CLASSPATH: /Users/wxm/java/apache-tomcat-7.0.82/bin/bootstrap.jar:/Users/wxm/java/apache-tomcat-7.0.82/bin/tomcat-juli.jar
Tomcat started.
5.测试
curl http://localhost:8080