Download, install, start, close tomcat8.x

Source: Internet
Author: User
Tags net command port number tomcat tomcat server oracle database

1) Download and unzip

Download tomcat 8.0 to URL http://tomcat.apache.org/

Some notes about 8.0:
This version is intended primarily for Oracle's Java EE 7 release in June , and in addition to supporting the latest Java EE specifications, the main improvements to this version are as follows in comparison with Tomcat 7:

Supports servlet 3.1, JavaServer Pages 2.3, Java Unified Expression Language 3.0, and WebSocket 1.0. The default connector implementation is now a Java non-blocking implementation (NIO) based on HTTP and AJP. A new resource implementation that can replace aliases, Virtualloader, virtualdircontext, jar resources, and a single, consistent external repository. More information: http://tomcat.apache.org/tomcat-8.0-doc/changelog.html

Download Address: http://tomcat.apache.org/download-80.cgi


Mine is a 64-bit win7 so download, unzip the custom path after the D:\apache-tomcat-8.0.3-windows-x64

Directory usage
/bin to store startup and shutdown Tomcat script files
/conf stores various configuration files for the Tomcat server, including Server.xml (Tomcat's primary profile), Tomcat-users.xml, and web. XML profiles

/lib Store the Tomcat server and the jar files that all Web applications need to access
/logs to store Tomcat log files
/temp storing temporary files generated by Tomcat runtime
/webapps
When you publish a Web application, you typically put the Web application's directory and files here
Directory
/work Tomcat places JSP-generated servlet source files and bytecode files into this directory

2) Run the environment configuration, run and manage Tomcat

In the bin subdirectory of the Tomcat installation directory, there are a number of batch files (files with a. bat suffix), where
The Startup.bat is to start the Tomcat script file, double-click the file with the mouse, you will see a window flash and
, and then there was nothing, which indicated that Tomcat's startup was wrong.

In case of error, open the DOS command window to enter CMD, enter the Tomcat bin directory, enter startup will appear error prompt.

Neither the Java_home nor the JRE_HOME environment variable is defined
At least one of these environment variable are needed to run the This program. Configure at least one of the

You will configure the Java_home or jre_home environment variable so that Tomcat can find the installation directory for the JDK or JRE.

From the name of the environment variable, we can guess that Java_home is the installation directory that configures the JDK, and Jre_home is the installation directory that configures the JRE.

Because the Tomcat 6.x no longer requires JDK support, the JRE_HOME environment variable was added, for Tomcat before 6.0
Version, there are no jre_home environment variables, only java_home environment variables can be configured. (For configuration environment variables see this blog post on the configuration of JDK environment variables)

If correct, as shown in the following figure:

Open the browser, enter http://localhost:8080/in the address bar (localhost means local machine, 8080 is the port number that Tomcat listens by default)

However, this port number is not good, joined the installation of the Oracle database, the use of 8080 ports, if the Oracle boot will not be able to enter the above page, if not started can go in, it is still a different port.

Enter the D:\apache-tomcat-8.0.3-windows-x64\apache-tomcat-8.0.3\config\ directory to configure, with UE open server.xml ctrl+f input 8080, found

<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
redirectport= "8443"/>

Change the 8080 to a port that is not yet occupied, such as 8001, then launch Tomcat and enter http://localhost:8001/to open the default Tomcat home page.

If you want to install Tomcat as a service for Windows so that Tomcat runs when the Windows system starts, you can
To open the Command Prompt window, enter the bin subdirectory under the Tomcat installation directory, and then execute the following command:
Service.bat Install
This will install a TOMCAT8 service on the Windows system, and to start the service, you can execute the following command:
net start Tomcat8
To stop the TOMCAT6 service, you can execute the following command:
net stop Tomcat8 to remove the TOMCAT8 service, you can execute the following command:
Service.bat Remove
To remind readers that the net command is a command that comes with Windows, Service.bat is a batch file provided by Tomcat.

If you want to start Tomcat in any directory, you need to set the CATALINA_HOME environment variable, and you can add catalina_home to the environment variable of the WINDOWSNT system, whose value is Tomcat's installation directory. On the author's machine, Tomcat's installation directory is D:\apache-tomcat-8.0.3-windows-x64\apache-tomcat-8.0.3. Add Catalina_home Ring
The process of boundary variables is the same as the procedure for adding java_home environment variables. Then add the path of the environment variable;%catalina_home%\bin can

Tomcat Management

Tomcat provides a hypervisor: Manager for managing Web applications deployed to the Tomcat server.
The manager Web application is included in the Tomcat installation package. To access the Manager Web application, you need to add a
Account with administrator privileges, edit%catalina_home%\conf\tomcat-users.xml file, <tomcat-users>
element to add the manager role and the user name and password that belong to that role.

After opening tomcat-users.xml, add the following two days statement to save the text last.

<role rolename= "Manager-gui"/>
<user username= "Tomcat" password= "Tomcat" roles= "Manager-gui"/>

Enter localhost:8001 in the browser, you can see the following page, click on the right one, enter the user name and password just set, go in can





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.