Tomcat authoritative guide Study Notes

Source: Internet
Author: User
Tags cert verification

1. Execute Tomcat-related scripts
The main script of Catalina tomcat, which runs Java commands to call the start and stop classes of Tomcat.
Shutdown the alias of Catalina stop, used to stop tomcat. (Default Tomcat HTTP server port 8080)
Startup Catalina start alias, used to start Tomcat. (Default port 8005 of Tomcat stop server)
Setclasspath is used inside the system to set the classpath environment variable of Tomcat

When running Catalina, a parameter must be included. The most common options are start, stop, and run. When you use the Catalina and start options, or call the startup script instead of the run parameter, you will see the first few lines of using ...; other output information is redirected to Catalina. out log file. Therefore, when you want to see the output at startup, the run parameter will be helpful, but standard output and errors will not be redirected.
The Catalina script also has several startup parameters:
-Config: specify another server. xml configuration file
-Nonaming: Disable JNDI in Tomcat
-Security: Enable the catalina. policy File
-Embedded test Tomcat in embedded Mode
-Jpda start starts Tomcat in a debugging environment that complies with the Java Platform Debugger Architecture.
 
Ii. Tomcat Environment Variables
CATALINA_BASE sets the basic directory for Tomcat to read and write data during runtime.
CATALINA_HOME: locate the Tomcat directory for the Tomcat Startup File, so that Tomcat can dynamically load its program code. The default value is the Tomcat installation directory.
CATALINA_OPTS sends the command line option to the java command
The alias of JAVA_OPTS CATALINA_OPTS
Java_home: Set the location of the Java environment
Jsse_home: Set the location of Java Secure socketsextension for HTTPS
Jpda_address: Specifies the JPDA address used for the Catalina JPDA start command. The default value is 8000.

The Java Runtime Environment has restrictions such as the "Maximum stack size. The options of the Java command allow you to control these restrictions, for example:
Java-xmx = 64 m myprog
The class file called myprog will be executed with a maximum of 64 MB memory.
When Tomcat is used, the execution servlet may occupy a lot of memory in the Java environment. If you want to pass this or other options to the Java command for Tomcat startup, before executing the Tomcat STARTUP script, you can set options in the environment variable catalina_opts. For example:
Export catalina_opts = "-xmx = 128 M" (Linux)
Set catalina_opts = "-xmx = 128 M" (MS-DoS)
It is best to add them to environment variables. in Linux, add a line in the/etc/profile file: Export catalina_opts = "-xmx = 128m"

Iii. Test and force stop Tomcat installation
1. Check whether Tomcat is running:
# Ps auwwx | grep Catalina. startup. Bootstrap (on Linux or * BSD)
You should see several Java processes. This ps command will look for any remaining Tomcat processes on the Tomcat JVM.
2. When Tomcat cannot be stopped normally, if you want to force it to end, you can send the sigterm signal to the process you found and tell the VM to end the process (please be sure you have the correct user permissions ):
# Kill-SIGTERM <process-ID-list>
Repeat Step 1. If there are other Tomcat JVM processes, repeat Step 2 until there are no processes at all. If these processes are still in progress, delete them in the following way:
# Kill-SIGKILL <process-ID-list>

4. Set Tomcat
1. Servet container or Web application itself can control the security protection of Web application resources. In the J2EE specification, the former is calledContainer-managed security protectionThe latter is calledApplication-managed security protection. Regardless of the type of security protection, users and passwords are managed using a group called realm. The domain is only a collection of users, passwords, and roles.
2. context in Tomcat is a technical term used for Web applications. This term has the same meaning as a Web application and has a set of corresponding XML elements and attributes. This range is defined in the Tomcat server. xml file.
3. Tomcat supports four types of container management security protection, and each type gets its identity in different ways.
Basic verification: through HTTP verification, the user's password is encrypted into base64-encoded text.
(Set the auth-method element to BASIC in the web. xml file)
Digest verification: uses HTTP verification to encrypt a user's password into a digest encoded string.
(In the web. xml file, set the auth-method element to DIGEST)
Form Verification: the user password is required on the form on the webpage.
(In the web. xml file, set the auth-method element to FORM)
Client-cert verification: Use the Client digital certificate to confirm the user's identity.
(In the web. xml file, set the auth-method element to client-cert)
The client-cert authentication method can be used only when you provide webpage content on SSL (that is, HTTPS.
4. JNDI is used to find the database source and other resources. When accessed through JNDI, these resources are called "context ).
Note: The scope of JNDI is completely different from that of Tomcat (which represents a Web application. In fact, the two are completely irrelevant.

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.