1. 首先进入tomcat文件夹
cd Desktop/tomcat7/bin
2. ls -al *.sh
3. chmod +x .*sh
4. ls -al *.sh
5. ./startup.sh
就可以启动tomcat了
6. ./shutdown.sh
关闭tomcat服务
***MacBook-Pro:~ ***$ cd Desktop/tomcat7/bin
***MacBook-Pro:bin ***$ ls -al *.sh
[email protected] 1 *** staff 21646 9 29 15:26 catalina.sh
[email protected] 1 *** staff 1922 9 29 15:26 configtest.sh
[email protected] 1 *** staff 8157 9 29 15:26 daemon.sh
[email protected] 1 *** staff 1965 9 29 15:26 digest.sh
[email protected] 1 *** staff 3547 9 29 15:26 setclasspath.sh
[email protected] 1 *** staff 1902 9 29 15:26 shutdown.sh
[email protected] 1 *** staff 1904 9 29 15:26 startup.sh
[email protected] 1 *** staff 5024 9 29 15:26 tool-wrapper.sh
[email protected] 1 *** staff 1908 9 29 15:26 version.sh
***MacBook-Pro:bin ***$ chmod +x *.sh
***MacBook-Pro:bin ***$ ./startup.sh
Using CATALINA_BASE: /Users/***/Desktop/tomcat7
Using CATALINA_HOME: /Users/***/Desktop/tomcat7
Using CATALINA_TMPDIR: /Users/***/Desktop/tomcat7/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Using CLASSPATH: /Users/***/Desktop/tomcat7/bin/bootstrap.jar:/Users/***/Desktop/tomcat7/bin/tomcat-juli.jar
Tomcat started.
***MacBook-Pro:bin ***$ ./shutdown.sh
Using CATALINA_BASE: /Users/***/Desktop/tomcat7
Using CATALINA_HOME: /Users/***/Desktop/tomcat7
Using CATALINA_TMPDIR: /Users/***/Desktop/tomcat7/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Using CLASSPATH: /Users/***/Desktop/tomcat7/bin/bootstrap.jar:/Users/***/Desktop/tomcat7/bin/tomcat-juli.jar
***MacBook-Pro:bin***$
这样就可以成功配置tomcat了。并成功启动和关闭tomcat了