Tomcat tutorial for IOS MAC configuration Tomcat tutorial for Mac environment configuration

Time:2021-3-1

Tomcat tutorial is configured in MAC environment. The specific contents are as follows

Tomcat configuration

1. Download Tomcat configuration package from the official website: http://tomcat.apache.org/download-70.cgi

2. After downloading, rename the whole folder after decompression: Apache Tomcat (the name is optional), and then put it in a file directory. I put it under / users / computer user name / library;

3. Open the terminal and enter the bin folder directory in the Apache Tomcat file;

4. Then start tomcat, the terminal input is/ startup.sh , if the prompt: – bash:/ startup.sh : permission denied, the startup fails, and the terminal needs to input: CHMOD U + X *. Sh authorization;

5. After authorization, input again to the terminal/ startup.sh , as shown in the figure below, the startup is successful;

6. Check whether it starts successfully and open it in the browser http://localhost : 8080 [localhost can be replaced with your IP address]. If the following page is displayed, it has been started normally;

7. To close tomcat, or in the bin folder directory, the terminal input/ shutdown.sh

Folder directory

1) Bin: store Tomcat command

2) Conf: to store Tomcat configuration information server.xml File is the core configuration file

3) Lib: jar package and technical support package (such as servlet and JSP) supporting Tomcat software

4) Logs: runtime log information

5) Temp: temporary directory

6) Webapps: shared resource file and web application directory

7) work:tomcat The temporary files generated by JSP runtime are stored here

Modify port number

The default port of the server is 8080, which can also be changed to a custom port. In order to avoid conflict with the system port, it must be set above 1024, for example, 8888

Use Notepad to open the server.xml File, change the port value 8080 of the following statement to a custom port number: (for example, 8020)

<Connector port=”8020″ protocol=”HTTP/1.1″

connectionTimeout=”20000″

redirectPort=”8443″ />

After restarting the server, enter localhost:8080 Invalid, input required localhost:8020 You can open the server interface

Password setting

Tomcat in the conf directory- users.xml Add the following code to the file < / Tomcat users >:

<role rolename=”manager-gui”/>

<user username=”tomcat” password=”tomcat” roles=”manager-gui”/>

Because all XML tags have to be closed and Tomcat has to be restarted http://localhost : 8080 to the main interface of tomcat, click the manager app button, input the account and password of Tomcat to login

Related reference: detailed explanation of Tomcat configuration steps in MAC environment

The above is the whole content of this article, I hope to help you learn, and I hope you can support developer more.