Source: http://www.cnblogs.com/freeyiyi1993/p/3436368.html
1. To the official Apache homepage, download the full tar.gz file package for MAC version. Unzip the copy to the/library directory and name Tomcat, and the other directories are available.
2, modify the directory permissions to the terminal input sudo chmod 755/library/tomcat/bin/*.sh 3, start Tomcat Press ENTER after the prompt for the password, please enter the administrator password. Then type and enter:
sudo sh startup.sh
The following prompt indicates that the installation and operation succeeded:
Using catalina_base:/library/tomcat
Using Catalina_home:/library/tomcat
Using Catalina_tmpdir:/library/tomcat/temp
Using Jre_home:/system/library/frameworks/javavm.framework/versions/currentjdk/home
4. Open the browser and enter http://localhost:8080/
If you see Apache Tomcat after the carriage return, it means that Tomcat has been successfully run
5. Configuration
TomcatStartup script:
Use the text editor to add the following code:
#!/bin/bash
Case $ in
Start
sh/library/tomcat/bin/startup.sh
;;
Stop
sh/library/tomcat/bin/shutdown.sh
;;
Restart
sh/library/tomcat/bin/shutdown.sh
sh/library/tomcat/bin/startup.sh
;;
*)
echo "Usage:start|stop|restart"
;;
Esac
Exit 0
Save the file as Tomcat, lowercase with no suffix. Give File Execution permissions:
chmod 777 Tomcat
。 Place this file in the path contained in the terminal, such as/usr/bin, and then simply enter Tomcat start and Tomcat stop in the terminal to enable Tomcat.
The shortcut commands are as follows:
1) Tomcat start
2) Tomcat stop
3) Tomcat restart
Installation and configuration of Tomcat under Mac