One. Download Tomcat
First go to the Tomcat official website to download the installation package, the official website is as follows: http://tomcat.apache.org/download-70.cgi, please download the version of the fly Windows. Unlike the Windows operating system, there is no annoying registry.
Unzip the package to any directory, I am here to store under the/programfile/tomcat directory
Two. Modify the authorization
Several of the running services in Tomcat end with *.sh and require authorization before running. Open terminal and enter the following command:
Enter the following command: sudo chmod 755/programfile/tomcat/bin/*.sh
Enter the password: Enter your local account password
Three. Start the Tomcat service
Use the CD command first to enter the Tomcat Bin directory with the following command:
cd/programfile/tomcat/bin/
To start a service command:
sudo sh startup.sh
Starting successfully, the following results will appear:
Using catalina_base: /programfile/tomcatusing catalina_home: /programfile//programfile /tomcat/tempusing jre_home: /system/library/java/javavirtualmachines/1.6. 0. jdk/contents/homeusing CLASSPATH: /programfile/tomcat/bin/bootstrap.jar:/programfile/tomcat /bin/tomcat-Juli.jartomcat started.
If the results appear as above, the Tomcat starts successfully
Four. Modifications to the Tomcat-related configuration
Open the/tomcat/conf/tomcat-users.xml file in Tomcat.
<tomcat-users><!--note:by Default, no user is included in the ' Manager-gui ' role required to operate the '/manager/html ' web applic ation. If you wish the This app, you must define such a user-the username and password is arbitrary. -<!--note:the sample user and role entries below is wrapped in a comment and thus is ignored when reading this file. Don't forget to remove <!.. .. > that surrounds them. -<!--<role rolename= "Tomcat"/> <role rolename= "role1"/> <user username= "Tomcat" password= "Tomcat" roles = "Tomcat"/> <user username= "Both" password= "Tomcat" roles= "Tomcat,role1"/> <user username= "Role1" Password= "Tomcat" roles= "Role1"/> -<rolerolename= "Manager"/><Userusername= "Tomcat"Password= "root"Roles= "Manager"/></tomcat-users>
The default <role> is commented, which is added as follows:
<rolename= "Manager"/><username = "Tomcat" Password = "root" Roles = "Manager" />
For more configuration changes, you can view information about Tomcat
This time input http://localhost:8080/should be able to access, do Java Web development should be very familiar, here no longer discuss
Install Tomcat under MAC