The first step is to download tomcat
Enter the official website
https://tomcat.apache.org/download-80.cgi
Click on the following hyperlink to install.
Step 2
Compress tomcat, and preferably rename the folder (named Tomcat), then drag it to /library
Shortcut key method: command+shift+G jump directly to the /library folder, and then copy and paste the tomcat folder here.
The third step is to open the terminal and enter the command to start tomcat
You can first enter ls to view the files in the current folder.
ls
1. Track the current file to the bin folder of library
cd /Library/Tomcat/bin
2. Enter to perform operations in the authorized bin directory.
sudo chmod 755 *.sh
Then enter the password and press Enter
3. Enter and start tomcat
sudo sh ./startup.sh
It shows that tomcat started successfully!
4. Inspection
Open URL:
If the tomcat page is displayed, it means that tomcat has started successfully!