编程知识 cdmana.com

Can you install Tomcat?

Tomcat Is a fit JavaEE WEB The smallest of standards WEB Containers , be-all JSP The program must have WEB Container support to run , And in the given WEB The container will support transaction processing operations .

  Tomcat By Apache Provided (www.apache.org), You can use the installation version and the decompression version , The installation version can appear in the service Tomcat Service for , No installation , The installation free version is used in the development . Tomcat In short, it's a run Java Web server of , The bottom is Socket A program of , So is it JSP and Servlet A container for .Tomcat yes Apache Software foundation (Apache Software Foundation) Of Jakarta A core project in a project , from Apache、Sun Developed with other companies and individuals .

   Because of Sun Participation and support , Abreast of the times Servlet and JSP Norms can always be in Tomcat It's reflected in . because Tomcat Advanced technology 、 Stable performance , And it's free , So deeply Java Fans love it and get the approval of some software developers , Become the more popular Web application server .

  Tomcat The server is a free open source Web application server , Application servers are lightweight , It is widely used in small and medium-sized systems and where there are not many concurrent users , Is development and debugging JSP Program preference . For a beginner , Think of it this way , When configured on a machine Apache The server , It can be used to respond to HTML( An application under the standard generic markup language ) Page access request . actually Tomcat Part of it is Apache Extension of the server , But it runs on its own , So when you run tomcat when , It's actually as a relationship with Apache Independent processes run alone .

   When the configuration is correct ,Apache by HTML Page services , and Tomcat It's actually running JSP Page and Servlet. in addition ,Tomcat and IIS etc. Web The server is the same , With processing HTML Function of page , And it's also a Servlet and JSP Containers , independent Servlet The container is Tomcat Default mode . however ,Tomcat Handling static HTML Not as good as Apache The server . at present Tomcat The latest version is 9.0.

Tomcat Installation mode

  • Make sure JDK The environment is configured correctly
  • Download from the official website Tomcat Installation package
  • Unzip the installation package
  • Integration into compiler tools

Case practice

   function Tomcat need JDK Support for 【Tomcat Will pass JAVA_HOME Find what you need JDK】. Installation is the decompression process . start-up Tomcat, If you can access it, it's installed

 The server Tomcat Will you install it ?

  1、 decompression  The server Tomcat Will you install it ? The server Tomcat Will you install it ?

 The server Tomcat Will you install it ?

  2、ROOT See... In the catalog index.html or index.jsp file

 The server Tomcat Will you install it ?

  Tomcat8 It comes with a page , and tomcat7 No need to install , If you visit directly, you will get 404 Tomcat7.XXX You need to check webapps->ROOT Is there... In the catalogue index.html perhaps index.jsp, If not, add one manually html File or copy it somewhere else jsp, If you can access this page, the configuration is successful .

  3、 start-up Tomcat ( stay tomcat Under the installation directory of bin Catalog Use the command line to start tomcat)

 The server Tomcat Will you install it ?

   The startup window cannot be closed after startup

 The server Tomcat Will you install it ?

  4、 Open the browser and type http://localhost:8080/ visit

 The server Tomcat Will you install it ?

  OK,Tomcat Installation successful .

  5、 close Tomcat ( stay tomcat Under the installation directory of bin Catalog Use the command line to turn off tomcat)

 The server Tomcat Will you install it ?

PS: Access to learning resources technology dry goods :lezijie003( Code 123)

Expand

Tomcat Directory structure

 The server Tomcat Will you install it ?

  1. bin: Startup and shutdown tomcat Of bat file
  2. conf: The configuration file server.xml This file is used for configuration server Relevant information , such as tomcat Starting port number , Configure the host (Host) web.xml File configuration and web application (web The application is equivalent to a web Site )tomcat-user.xml Configure user name, password and related permissions .
  3. lib: The directory is placed to run tomcat Required for operation jar package
  4. logs: Storage log , When we need to check the log , You can query information
  5. webapps: Put our web application
  6. work working directory : This directory is used to store jsp After being accessed, the corresponding server Document and .class file

Eclipse relation Tomcat

Window→preferences→Server→Runtime Environment→add→apache-tomcat-8.0.23

 The server Tomcat Will you install it ?

版权声明
本文为[osc_ q5urtsdm]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225125426591s.html

Scroll to Top