Installing Tomcat on a Mac system

Source: Internet
Author: User
Tags gz file

http://blog.csdn.net/chenlia/article/details/7692361

Download the full. gz file package for MAC version to the official Apache homepage. Unzip the copy to the/library directory.

1. How the Finder opens the library in Mac

New Finder Window Press SHIFT +command+g Enter/library to enter the hidden directory.
PS: This shortcut key is very useful, be sure to remember!

2. Modify Directory Permissions

Select Folder Command+i Open Introduction, modify file Permissions command sudo chmod 755/library/tomcat (give a 777 permission also does not matter)

To install Tomcat:

    1. Download the latest Tomcat binary code package on the Apache website: (Be careful not to download the installation package for Windows) http://tomcat.apache.org/(Mac is. gz)

    2. When you're done downloading, unzip and name the folder Tomcat

    3. Move the renamed folder to the root directory /library (available elsewhere), and the installation process is complete.

    4. Perform /library/tomcat/bin under startup.sh, and then open http://localhost:8080 to see if Tomcat is started, to stop the server from running in the same directory as the shutdown.sh

If you encounter problems such as the inability to find directories and file places, it is generally because the file permissions are causing problems that you can resolve:

sudo chmod 755/library/tomcat/bin/*.sh
sudo chmod 755/library/tomcat/bin/*.bat

Meet "Java_home not defined" JAVA path undefined error, execute the following command in Terminal:

sudo setenv java_home/library/java/home

To configure the Tomcat startup 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

It's very convenient!

Installing Tomcat on a Mac system

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.