Basic configuration and installation of a Tomcat server without Installation

Source: Internet
Author: User

During the holidays, I installed it occasionally. I tried both the installation and installation-free versions. I think the installation-free version is better. There are many configurations and many files involved, based on my current knowledge, I have simply completed the basic configuration and installation method of the installation-free version of tomcat.

1. Configure JDK

To install Tomcat on your computer, JDK support is required, because Tomcat is a lightweight Web Server written in java.

Latest Java SE: http://www.jb51.net/softs/75615.html

1. First download the downloaded jdk (1.7 here), decompress or install it. It is best to install jdk and jre in the same java directory, such as d: \ Program Files \ java \ jdk1.7.

2. Configure System Variables

(1) Right-click "my computer", select "properties"-"advanced", and click "environment variables ".

(2) In order to easily change the jdk path and some other software in the future, it is best to create a JAVA_HOME environment variable with the property value "d: \ Program Files \ java \ jdk1.7 ", add "% JAVA_HOME % \ bin" to the path environment variable, preferably in front.

(3) Click "new" in the "user variables" box, enter "classpath" in the "variable name" field, and enter "." in the "variable value" field. % JAVA_HOME % \ lib \ tools. jar; % JAVA_HOME % \ lib \ rt. jar ". After the configuration is complete, enter java-version in the Command window to view the current version. If a prompt is displayed, the operation is successful.

2. Configure Tomcat

1. Download The tomcat.zip package. I am using the latest 7.0.27 and decompress it to the d: \ Program Files \ tomcat7 directory. Tomcat: http://tomcat.apache.org/download-70.cgi. select the 32-bit Windows zip or 64-bit Windows zip option on the download page.

2. environment variable settings:

First, add the TOMCAT_HOME environment variable with the value d: \ Program Files \ tomcat7. Add the CATALINA_HOME environment variable with the value % TOMCAT_HOME %. Add the CATALINA_BASE environment variable with the value % TOMCAT_HOME %. The installation-free version requires these two environment variables, which are written as "%" to facilitate later version changes. You can directly modify the TOMCAT_HOME value, change the values of CATALINA_HOME and CATALINA_BASE.

For a version without installation, the most important thing is to modify the startup. bat file in the conf folder under the root directory. If you do not modify the file, you may not be able to start Tomcat,

Add the following two lines before the first line (or after echo off:

SET JAVA_HOME = JDK directory

SET CATALINA_HOME = the Tomcat directory after decompression.

If you need to use shutdown. bat to shut down the server, add two lines as shown above.

3. In this way, run startup. bat to run the server, and run shutdown. bat to close the server.

3. Add Tomcat to the service

1. If zipping is downloaded from the internet and Tomcat is added to the service, Tomcat cannot be configured, And the setting window opened by the program atw.exe cannot be opened.

First, run Win + R to open the run dialog box, enter the cmd command to open the console, use the cd command to enter the Tomat directory/bin folder, and enter the following command:

Service. bat install

Program prompt: The service 'tomcat 7' has been installed similar statement.

It indicates that the Tomcat service has been installed successfully. By the way, if you do not want tomcat, you can run service. bat remove to remove the service. That is, uninstall.

3. Here, the service is successfully added, and then enter services in the running window. msc command. In the service window, you can see that the tomcat service has been added to the system. You can see the added service. By default, the service runs manually. In its properties, change the Startup Type to "automatic". After the machine is started, Tomcat will be started in the background (generally not set this way ).

4. Tomcat Startup Mode

There are multiple startup methods for the tomcat server.

First, start the service (server) in the command console. In the command window, enter the following statement to open or close the tomcat server:

Net start service name

Net stop service name

Method 2: Use startup. the bat batch file opens the tomcat server and uses shutdown. if the bat batch file is used to close the tomcat server, you must add the preceding two statements to this method. Otherwise, the tomcat server cannot be opened or closed.

Type 3: Enter the bindirectory under the tomcat directory, select a file such as tomcat7w.exe, select start in the window to open, or select stop to close the server.

Method 4: This method is similar to the first one. Open the service window, select the service name of the tomcat server, right-click and choose start or stop.

For the preceding four startup methods, the service is started.

The preceding operations are simple. You can easily configure tomcat without installation!

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.