- 下载Tomcat
地址: http://tomcat.apache.org/download-70.cgi
-
将下载的文件放到一个位置
image.png -
启动
cuilinhaodeMacBook-Pro:~ cuilinhao$ cd /Users/cuilinhao/Documents/apache-tomcat-7.0.88/bin
然后直接 ./startup.sh
如果出现 -bash: ./startup.sh: Permission denied
则,执行cuilinhaodeMacBook-Pro:bin cuilinhao$ chmod u+x *.sh 就会有权限
再次 ./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.
访问:打开你的 safari ,然后网址输入 http://localhost:8080/
这时,tomac就相当于是一个你自己电脑的服务器,访问某个文件,
可以直接这样
http://localhost:8080/tomcat-power.gif
出现下图
image.png
关闭
$:./shutdown.sh
查看版本
$:sh catalina.sh version
网友评论