【JavaWeb】Tomcat

web server software:

: The server computer server software installed

Server Software: receiving a user's request, processes the request, responds

web server software: receiving a user's request, process the request, responds.
In the web server software, you can deploy web projects, allowing users to access these items through a browser
web container

Tomcat: web server software

  1. Download: http://tomcat.apache.org/
  2. Installation: extract the archive to
  3. Uninstall: Delete the directory on the line
  4. start up:
    • bin / startup.bat, double-click the file to run
    • Access: Enter the browser: http: // localhost: 8080 Enter access to your
      http: // others ip: 8080 visit others

    • Possible problems encountered:
      1. Black window flashed:
        • The reason: the JAVA_HOME environment variable is not configured correctly
        • Solution: Configure JAVA_HOME environment variable
      2. Start being given:
        1. Violence: find the port number occupied, and find the corresponding process, kill it
          • netstat -ano
        2. Gentle: modify its port number
          • conf/server.xml
          • The default port number of the general will is 80.80 tomcat port number is the default port number for http protocol.
            • Benefits: When you visit, do not enter the port number
  5. shut down:
    1. Normally closed:
      • bin/shutdown.bat
      • ctrl+c
    2. Forced off:
      • Click Start window ×
  6. Configuration:
    • Deployment of the project:
      1. The project can be put directly under the webapps directory.
        • / Hello: access path of the project -> Virtual Directory
        • Simplify deployment: the project package labeled as a war, then war pack is placed under the webapps directory.
          • war package will automatically unzip
      2. Configuration conf / server.xml file (generally do not have this, because this is a core document)
        in Tag body configuration
        <Context docBase = "D: \ hello" path = "/ hehe" />
        • docBase: items stored path
        • path: Virtual Directory
      3. In conf \ Catalina \ localhost create xml file any name. Written in the file
        <Context docBase = "D: \ hello" />
        • Xml file name: Virtual Directory
    • Static items and dynamic items:
      • Directory Structure
        • java directory structure in a dynamic entry:
          - the project root
          - WEB-INF directory:
          - the web.xml: Web items core profile
          - Catalog classes: directory to bytecode files
          - lib directory: placing dependent jar package

Guess you like

Origin www.cnblogs.com/LampsAsarum/p/12301096.html