Install Tomcat under MAC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.