Javaweb Learning Tomcat installation and operation, Tomcat directory structure, configuration of Tomcat management user, Web project directory, virtual directory, virtual host (1)

Source: Internet
Author: User

1.tomcat Installation and operation
Double-click Bin/startup.bat in the Tomcat directory, enter http://localhost:8080 after startup, prompt for successful installation, indicating successful installation of Tomcat

Directory Structure of 2.tomcat
* Bin directory: The startup and termination scripts that hold Tomcat
* Startup.bat Startup script
* Bootstrap.jar, Startup script final Java program execution
* Org.apache.catalina.startup.Bootstrap
* Shutdown.bat Terminate Script
* conf directory: Files that hold all of Tomcat's configuration information "must"
* Tomcat-users.xml: Manage user rights
* Web. xml: To manually write website. xml
* Server.xml: Modify configuration (Modify port, add virtual path, add virtual Host)
* Lib directory: jar that holds all of Tomcat's features
* Tomcat:web server, servlet container
* Tomcat only implements JSP, servlet
* Logs directory: Log directory
* Temp Directory: Temp folder
* WebApps directory: The directory where Tomcat maintains all Web applications is "must"
* ROOT--/
* Work directory: Tomcat processing JSP files working directory "must"

3. Configure the management user for Tomcat "must"
* File Location
*%tomcat%/conf/tomcat-users.xml
* Add content
<!-- Declares the currently required role-->
<role rolename= "Manager-gui"/>
<!--determine the current user's account and password, and the role--> used;
<user Username= "root" password= "root" roles= "Manager-gui"/>
* Restart Tomcat

4.web project directory "must"
| Web Project
| --Web-inf Directory: The resource directory to block browser access. This directory browser is not visible
* Store configuration information for Web projects
* Store Web project-dependent JAR files
* The class file generated by the source file of the current web
| --Web. xml file: A configuration file for a website project
* Contents of configuration information:%tomcat%/conf/web.xml, copy root element
| --lib directory: the location of the dependent jar file
| --Classes Directory: Where class files are stored

5. Virtual directory:
* File Location:%tomcat%/conf/server.xml
* Configuration Content
<context path= "/xxx" docbase= "F:\workspaces\20120909\day04\WebRoot"/>
* Path: Browser access paths
* DocBase: The actual folder location of the current path mapping
* Note: Specify to a Web project
* Purpose: Extend the WebApps Directory management project

6. Virtual Hosting
* Local domain name effective cause localhost
* C:\WINDOWS\system32\drivers\etc\hosts
* 127.0.0.1 localhost
* Hosts file
* Write URL to access resources
* The role of IP: only responsible for locating the desired host location
* Configuration content (mainly for binding domain name use)
* Note: The host file needs to be modified

Javaweb Learning Tomcat installation and operation, Tomcat directory structure, configuration of Tomcat management user, Web project directory, virtual directory, virtual host (1)

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.