Simple steps for installing Tomcat servers on Mac OS _java

Source: Internet
Author: User

A. Download tomcat

First to the Tomcat official website to download the installation package, the official website download address is as follows: http://tomcat.apache.org/download-70.cgi, please download the fly Windows version. Unlike the Windows operating system, there is no annoying registry.

Unzip the compressed package to any directory, and I'll store it under the/programfile/tomcat directory.

Two. Modify the authorization

Several running service programs in Tomcat end with *.sh and require authorization before running. Open the terminal and enter the following command:

Enter the following command:

sudo chmod 755/programfile/tomcat/bin/*.sh

Enter the password: Enter the password for the local account

Three. Start Tomcat service

First use the CD command to enter Tomcat's Bin directory, which commands the following:

cd/programfile/tomcat/bin/

To start the service command:

sudo sh startup.sh

Start successfully, the following results appear:

Using catalina_base:  /programfile/tomcat
using catalina_home:  /programfile/tomcat
using Catalina_ Tmpdir:/programfile/tomcat/temp
Using jre_home:    /system/library/java/javavirtualmachines/1.6.0.jdk/ Contents/home
Using CLASSPATH:    /programfile/tomcat/bin/bootstrap.jar:/programfile/tomcat/bin/ Tomcat-juli.jar
Tomcat started.

If the result appears as above, it indicates that Tomcat started successfully

Four. Modification of 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
 Opera Te the "/manager/html" Web application. If you are wish to use this app, you
 must define such a user-the username and password are.
-->
<!--
 note:the sample user and role entries below are wrapped in a comment and
 thus are when Reading this file. Don't forget to remove
 <!.. .. > that surrounds them.
-->
<!--
 <role rolename= "Tomcat"/>
 <role rolename= "Role1"/>
 Username= "Tomcat" password= "Tomcat" roles= "Tomcat"/>
 <user username= "Both" password= "Tomcat" roles= " Tomcat,role1 "/> <user username= role1" password= "Tomcat" roles= "
 role1"/>-->
Rolename= "Manager"/>
<user username= "Tomcat" password= "root" roles= "manager"/>
</ Tomcat-users>

The default <role> are annotated, and this is added as follows:

<role rolename= "manager"/>
<user username= "Tomcat" password= "root" roles= "manager"/>

More configuration changes to see Tomcat related information

This time input http://localhost:8080/should be able to access, do Java Web development should be very familiar with, no longer discussed here

Related Article

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.