Basic configuration and installation of _win servers for a tomcat server that is free of installation

Source: Internet
Author: User
Tags tomcat server java se

It was occasionally installed during the holidays, installation and installation version of all tried, feel free to install version of the better, involving more configuration, more documents, according to my current knowledge, simple to do a free installation version of Tomcat basic configuration and installation methods.

First, configure the JDK

To install Tomcat on your computer requires JDK support, because Tomcat is a lightweight Web server written in the Java language.

Latest version of Java se download address: http://www.jb51.net/softs/75615.html

1, first download your own JDK (used here is 1.7) after downloading, decompression or installation, 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 on "My Computer", select "Properties"-"Advanced", and click "Environment variables".

(2) In order to easily change the JDK path, and some other software, it is best to create a new java_home environment variable, the property value is "D:\Program files\java\jdk1.7", will "%java_home%\bin" Added to the PATH environment variable, preferably in the front.

(3) At the end of the "User variable" box click on the "New" button, "Variable name" fill "classpath", "Variable value" fill. %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. The prompt information represents success.

Second, configure Tomcat

1, download the Tomcat.zip package, I use is now the latest 7.0.27, extracted into the D:\Program files\tomcat7 directory. Tomcat's download address is: http://tomcat.apache.org/download-70.cgi, select 32-bit Windows Zip or 64-bit Windows zip option on the download page.

2 setting of environment variables:

First, add the tomcat_home environment variable, the value is D:\Program files\tomcat7. Add the Catalina_home environment variable, the value is%tomcat_home%, add the catalina_base environment variable, and the value is%tomcat_home%. The installation-free version requires these two environment variables, written with the "%" to do so in order to later change the convenience of the version, you can directly modify the value of Tomcat_home, change the value of Catalina_home and Catalina_base.

The most important thing for an installation-free version is to modify the Startup.bat file under the Conf folder under the root directory, and if you do not modify it, you may not be able to start Tomcat.

In front of the first line (or after echo off), add the following two lines:

Directory for SET JAVA_HOME=JDK

SET catalina_home= The directory of Tomcat before decompression.

If you need to use Shutdown.bat to shut down the server, add two lines to it.

3, so, run Startup.bat can run the server, run Shutdown.bat can shut down the server.

Iii. adding tomcat to the service

1, download the zip version from the Internet, the need for Tomcat to join the service, or can not configure Tomcat, that is, can not open the Tomcatw.exe this program opened the Settings window.

First run Win+r Open the Run dialog box, enter the cmd command to open the console, use the CD command to enter the Tomat directory/bin folder, enter the following command:

Service.bat Install

Program hint: The service ' TOMCAT7 ' has been installed similar statement.

Description Service Tomcat has been successfully installed. Incidentally, when you do not want this tomcat, you can run Service.bat remove to remove the service. That is, uninstall.

3, to here, service added successfully, then enter the Services.msc command in the Run window to open the service window to see that the Tomcat service has been added to the system, and you can see the added service, which is manually run by default, and in its properties, change the Startup type to "Automatic" , after the machine started, Tomcat started in the background (generally not so set).

Iv. How to start tomcat

There are a number of startup methods for Tomcat for this server.

First: Start the service (server) in the command console, enter the following statement in the Command window to turn the Tomcat server on or off:

Net START service Name

NET stop service Name

Second: Use startup.bat batch file to open the Tomcat server, use the Shutdown.bat batch file to shut down the Tomcat server, in which case you need to add two words above, otherwise you cannot turn on or off the Tomcat server.

Third: Into the Tomcat root directory under the bin directory, select Tomcat7w.exe file, in the open window select the Start button to open, or select the Stop button to shut down the server.

Fourth: This approach is similar to the first, by opening the service window, select the Tomcat Server service name, right-click to select Start or stop.

For the above four kinds of startup methods, its fundamental is to start the service.

These are just simple operations, through this operation, you can easily configure the installation of Tomcat-free!

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.