Tomcat7.0 configuration tutorial (install JDK and increase system variables)

  

Xiaobian's friend's unit has a new WEB server, the software only supports running under TomCat, this friend came to ask 45IT.com Xiaobian But Xiaobian is not too familiar, so I checked the information, now let's learn how to configure TomCat7.0.

First, install JDK 1.7

1, JDK1.7 download address: enter the official download

2, add environment variables: in my computer -> properties -> ;Advanced->Environment Variable

2. New system variable, variable name: JAVA_HOME Variable value: C:\\Program Files\\Java\\jdk1.7.0 (JDK installation directory)

3 Add the English semicolon after the original system variable Path, and then add %JAVA_HOME%\\bin;%JAVA_HOME%\\lib\\dt.jar;%JAVA_HOME%\\jre\\bin; Do not delete the original one. See clearly, the semicolon between them is a semicolon in English.

4, restart the computer is effective (because the system variable is added, if your system is win7/2008, you do not need to restart).

4, test whether the JDK installation is successful, run -> cmd -> D: Enter the D drive, enter javac to see if a lot of commands come out, the JDK configuration is successful.

Second, Tomcat 7.0 installation configuration

1, Tomcat 7.0 (please go to the official website to download) free installation configuration (if you extract Tomcat to C:\\Program Files directory, directory structure For: C:\\Program Files\\apache-tomcat-7.0.11

1. Add environment variables: in My Computer -> Properties -> Advanced -> Environment Variables

2, create a new system variable, variable name: CATALINA_HOME variable value: C: \\ Program Files \\ apache-tomcat-7.0.11 (Tomcat decompressed to the directory).

3, at the end of the system variable Path %CATALINA_HOME%\\lib;%CATALINA_HOME%\\lib\\servlet-api.jar;%CATALINA_HOME%\\lib\\jsp-api.jar Note that the semicolon between them must be a semicolon in English.

4, Tomcat 7.0 administrator configuration, enter the conf directory under C:\\Program Files\\apache-tomcat-7.0.11 (Tomcat directory), edit tomcat-users.xml, find the last:

<!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat" /> < ;user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> - -> Add the following paragraph: <role rolename="manager-gui"/> <role rolename="admin-gui"/> <user username="admin" password= "veryhuocom" roles="admin-gui"/> <user username="tomcat" password="veryhuocom" roles="manager-gui"/>

Red is added section. At this point, you should know the user name and password of the administrator we added!

5. Enter the bin directory under the Tomcat directory, double-click startup.bat to start Tomcat. The command prompt will appear in the command line window.

6, browser input: http://localhost:8080 You can see the Tomcat welcome page to indicate that the configuration is successful, click on the manager connection in the upper right corner, enter the user name and password configured above, you can enter Management page.

Copyright © Windows knowledge All Rights Reserved