Apache tomcat installation, configuration, startup, and subsequent steps

Source: Internet
Author: User
Tags server port apache tomcat

1. First, before we install Apache Tomcat, we first install and configure the JDK;

2. Second, we need to be clear about our JDK version. Because the premise of our Apache Tomcat configuration is that the version corresponds. Here, the blogger is using the JDK version of the following figure:


So, when we download Apache Tomcat, we also need to find the corresponding version of Tomcat.

3. Download the official website link: http://tomcat.apache.org/download-70.cgi;


Download can be done by following the location where the arrow points. PS: Bo main computer is Win7 32-bit, so readers please follow the properties of their own computer to make changes. Also, Windows system is best to download the ZIP package, the Linux system is best to download the tar package. It is best not to download the Tomcat installation file because the console command output is not visible when the installation file is started.


4. Unzip the corresponding zip file to any directory on the machine, I install it to extract to (extract to the specified folder will appear two layers named the same folder layer, please readers do not worry, the following figure is the second layer):


The corresponding file contents are shown in the following figure (environment variables operate similar to JDK's):

5. Configure related environment variables, because I have previously configured the Java Development time environment, that is, JDK. So java_home no longer has to configure
1 environment variable 1:catalina_home, environment variable value: D:\apache-tomcat-7.0.67-windows-x86\apache-tomcat-7.0.67
(environment variable value is the corresponding zip file extract directory)

2 environment variable 2:catalina_base, environment variable value: D:\apache-tomcat-7.0.67-windows-x86\apache-tomcat-7.0.67

(Same as Catalina)
3 environment variable 2:tomcat_home, environment variable value: D:\apache-tomcat-7.0.67-windows-x86\apache-tomcat-7.0.67
(Same as Catalina)
4 the environment variable 3:calsspath, modify the environment variable value, and then add:%catalina_home%\lib\servlet-api.jar;
5 The environment variable 4:path, modify the environment variable value, and then add:%catalina_home%\lib\servlet-api.jar;

Photo display:







6. Start Tomcat, and look under the Bin folder in the Tomcat extract directory. For my machine: The D:\apache-tomcat-7.0.67-windows-x86\apache-tomcat-7.0.67\bin directory has a Startup.bat script program that executes the appropriate program to start Tomcat.

Note that we can also use the following actions to determine whether the startup was successful:

1, method One: In the cmd command to enter the command: Startup, the following dialog box appears, indicating that the service started successfully.

2, method Two: Right-click on the desktop "My Computer"-> "Management"-> "services and Applications"-> "services" to find "Apache Tomcat" service, right click on the service, select "Properties", the "Start type" from "Manual" to "automatic."




After you start, you will see the following in the terminal:



At this point, enter http://localhost:8080 in the address line of the browser. The tomcat configuration succeeds if the following page appears.


7.Tomcat Service Port Configuration
Tomcat's default service port is 8080, and we can change the server port by managing Tomcat's profile, and even allow Tomcat to service multiple ports at the same time by modifying the configuration file.
Tomcat configuration files are placed in the Conf directory, and the control port configuration file is also placed in the directory. Open the Server.xml file under the Conf file. Be sure to use an unformatted editor such as Notepad or VI, and do not use a format editor such as WordPad. To locate the Server.xml file, you can see the following code:
<connector port= "8888" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>
In this case, 8888 is the native open service port that I have changed. When you restart Tomcat, change the port number of the appropriate address to display the corresponding Tomcat Web page.
8.Tomcat Console Management
Tomcat has altogether three consoles:
1 Server Status console for monitoring the status of servers
2 Manager app console to monitor and deploy Web applications
3) Host Manager console
Usually we just use the Manager app console. To enter the console, you first create a console user. We add users by editing the Tomcat-user.xml file under the Conf folder, and modify the contents of the Tomcat-users.xml file as follows:
<tomcat-users>
<role rolename= "Manager-gui"/>
<user username= "xxx" password= "xxx" roles= "Manager-gui"/>
</tomcat-users>
A user named XXX with a password of xxx is added.

These are the steps for all installation and configuration.


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.