This article has participated in the activity of “New person creation Ceremony”, and started the road of digging gold creation together.

directory

Tomcat Environment setup (Win10)

Tomcat deployment


Tomcat is a common free Web server.

Tomcat Environment setup (Win10)

There are some problems in the process of building, I looked for solutions on the Internet, and found that there are still some problems, record them

Tomcat download

How2j. Cn/frontdownlo…

Unzip the file and open it

Tomcat startup

The CMD window goes to the bin directory

Startup. bat Directly starts Tomcat

There is a problem

1. Port conflict (check whether port 8080 is occupied)

2. JDK environment variables are incorrectly configured

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

Solutions:

Add the JAVA_HOME and JRE_HOME environment variables

In the initial state, my JAVA environment variable looks like this

New JAVA_HOME

The variable value is the location of my JDK package

New JRE_HOME

The variable value is the JRE path in my JDK package

The final configuration result is as follows (you must click OK to exit after the configuration takes effect)

Restart the CMD window

If the following information is displayed, Tomcat is successfully started

Tomcat is successfully started

A response is displayed if the page is accessed successfully

Tomcat deployment

Use a J2EE application project to test

How2j. Cn/frontdownlo…

Modify the server. XML file in the conf directory corresponding to Tomcat8080 to remove the comment identifier

Here my J2EE path is D:\ Java \j2ee, change the docBase= path (note \) and remove the comment

<Context path="/" docBase="D:\java\j2ee\web" debug="0" reloadable="false" />
Copy the code

Close Tomcat and run startup.bat again. Then enter the following url and see the screenshot shown in the figure, it indicates that the deployment is successful.

​​