1. Download tomcat (address: tomcat.apache.org), select the appropriate version (choose 6.0.35 here), click "Download", then click "tar.gz" under "core" on the new page (6.2MB)
2. Unzip the Tomcat to directory:/library, and change the folder name from "apache-tomcat-6.0.16" to "Tomcat"
3. Open "Application (Application)"--"terminal (Terminal)", enter the following two commands:
sudo chmod 755/library/tomcat/bin/*.sh
After pressing ENTER, you will be prompted for your password, please enter your 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. Enter the command in the terminal sudo sh/library/tomcat/bin/shutdown.sh enter to turn off Tomcat.
6.IP Address filtering
Tomcat uses a mechanism called valves (valve) to filter IP addresses. Common valves (valves) are removteaddrvalve and can be filtered by IP address. Valves can be applied at 3 levels: Engin,host,context.
If you only allow native addresses (localhost) to access the Tomcat server, you can use the following statements in Server.xml:
<engine name= "Catalina" defaulthost= "localhost" debug= "0" >
<valve classname= "Org.apache.catalina.valves.RemoteAddrValve"
allow= "127.0.0.1,0:0:0:0:0:0:0:1%0,::1"/>
Tomcat uses Java.util.regex to match the IP address.
Go from Network
How to install Tomcat under the Mac OSX system