Tomcat admin config

Source: Internet
Author: User
Today, I downloaded Tomcat for version 5.5.12. It took me half a day to learn about Tomcat 5.0.28 and the default admin module was unavailable, I thought my configuration was wrong (it took me half an hour to find out the reason :(). The following are some tips on Tomcat configuration on the Internet. The configuration method has been properly modified without modifying the original text, marked in red. Currently, the latest JDK is 1.5 + tomcat5.5.12. Only simple configuration is provided here.
Jdk1.5:
Java_home = C:/j2sdk1.5
Classpath =.; % java_home %/lib/dt. jar; % java_home %/lib/tools. jar; (.; must not be small, because it represents the current path)
Path = % java_home %/bin

Tomcat 5.5.12:
Catalina_home: C:/tomcat
Catalina_base: C:/tomcat
Tomcat_home: C:/tomcat
Modify classpath, classpath = .; % java_home %/lib/DT. jar; % java_home %/lib/tools. jar; % catalina_home %/common/lib/servlet. jar; start Tomcat and access http: // localhost: 8080 in IE. If you see the welcome page of Tomcat, the installation is successful.

The following problems may occur frequently:
1. Download http://www.eu.apache.org/dist/jakarta/tomcat-5/
In this case, jakarta-tomcat-5.0.28.execorresponds to a local Admin module. In jakarta-tomcat-5.5.9.exe, the default admin module is not installed. When http: // 127.0.0.1: 8080/admin is enabled
Tomcat's administration Web application is no longer installed by default. download and install the "admin" package to use it.
Therefore, we need to download the "admin" package
Decompress the jakarta-tomcat-5.x.zip and the jakarta-tomcat-5.5.x-compat.zip and jakarta-tomcat-5.5.x-admin.zipin the same directory (if jdk1.4 is used, then compat.zip with jdk1.5 can be exempted from this .) If jdk1.5+tomcat5.5.12is used, unzip the jakarta-tomcat-5.5.x-admin.zip file to the Tomcat directory.

2. Modify jakarta-tomcat-5.5.x/CONF/tomcat-users.xml.
Add the Administrator account lizongbo with the password lizongbopass .)
The new XML is as follows:









Sometimes some modifications are made in % catalina_home %/Server/webapps/admin/WEB-INF/Web. xml



Tomcat server configuration security constraint

Protected Area

*. Jsp
*. Do
*. Html



Admin



Form
Tomcat server configuration form-based authentication Area
/Login. jsp

/Error. jsp




The role that is required to log in to the Administration Application

Admin

Whether authentication or authorization (permission control only sets the relevant admin role, when you want to add or modify the relevant AA, you must modify this file, to meet your environment.

3. Modify jakarta-tomcat-5.5.x/CONF/server. XML to solve the encoding problem.
(Add uriencoding parameters to connector, refer to http://blog.csdn.net/darkxie/archive/2004/10/25/TOMCATAPP.aspx)
(It can be set to gb18030)
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "200"
Connectiontimeout = "20000" disableuploadtimeout = "true" uriencoding = "GBK"
Compression = "on" compressionminsize = "2048"
Nocompressionuseragents = "gozilla, Traviata"
Compressablemimetype = "text/html, text/XML"/>

Enablelookups = "false" redirectport = "8443" protocol = "AJP/1.3" uriencoding = "GBK"/>
(This is still a headache. It is not ideal to try several methods. It still needs to be solved. maxhttpheadersize = "8192 ")

4. enable support for gzip compression.
(Http://www.linuxaid.com.cn/forum/showdoc.jsp? L = 1 & I = 81169)
Add the following attributes
Compression = "on"
Compressionminsize = "2048"
Nocompressionuseragents = "gozilla, Traviata"
Compressablemimetype = "text/html, text/XML"

5. Set the VM.
Create the folder vhost/www.mydomain.com under the jakarta-tomcat-5.5.x.
Then modify the jakarta-tomcat-5.5.x/CONF/server. xml


6. Add the database driver and update Mail. jar and actiovation. jar.
Copy mysql-connector-java-3.0.16-ga-bin.jar, pg74.215.jdbc3. jar to jakarta-tomcat-5.5.x/common/lib/
And javamail 1.3.2 mail. jar, jaf-1_0_2 activation. Jar
MSSQL 2000 JDBC SP3, msbase. jar, msutil, jar, MSSQLServer. Jar

7. Configure SSL
Reference http://jakarta.apache.org/tomcat/tomcat-5.5-doc/ssl-howto.html
D:/j2sdk1.4.2 _ 06/bin> % java_home %/bin/keytool-genkey-alias tomcat-keyalg RSA
Enter the keystore password: lizongbossl
What is your first name and last name?
[Tomcat5.5.x]: tomcat5.5.x
What is the name of your organization?
[Jakarta]: Jakarta
What is your organization name?
[Apache]: Apache
What is the name of your city or region?
[Hzcity]: hzcity
What is the name of your state or province?
[GDP]: GDP
What is the two-letter country code for this unit?
[CN]: CN
CN = tomcat5.5.x, ou = Jakarta, O = Apache, L = hzcity, St = GDP, c = cn correct?
[No]: Y

Input Master password
(If the password is the same as the keystore password, press Enter ):

(The password must be consistent, so press enter directly)
Then copy the. keystore in userhome (for example, C:/Documents and Settings/lizongbo/)
In the conf/directory of Tomcat.
(Example: D:/jakarta-tomcat-5.5.x/CONF/. keystore
Configure jakarta-tomcat-5.5.x/CONF/server. xml
Add
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" disableuploadtimeout = "true"
Acceptcount = "100" Scheme = "HTTPS" secure = "true"
Clientauth = "false" sslprotocol = "TLS"
Keystorefile = "CONF/. keystore"
Keystorepass = "lizongbossl">

8. Disable the file directory list,
Modify jakarta-tomcat-5.5.x/CONF/Web. xml and set listing to false


Default
Org. Apache. Catalina. servlets. DefaultServlet
Debug

0
Listings

True
1

9. You have specified your own javaencoding.
(Reference http://gceclub.sun.com.cn/staticcontent/html/sunone/app7/app7-dg-webapp/ch6/ch6-4.html


JSP
Org. Apache. Jasper. servlet. jspservlet
Fork

False
Javaencoding

Gb18030
Xpoweredby

True
3

10. Add mime-type ing for RAR and ISO
Avoid opening it directly in the browser.

MHT
Text/X-MHT


RAR
Application/octet-stream


ISO
Application/octet-stream


Ape
Application/octet-stream


Rmvb
Application/octet-stream


ICO
Image/X-icon

10.1 set encoding for HTML static pages


Htm
Text/html; charset = gb2312


Html
Text/html; charset = gb2312

11. Add welcome-file-list and adjust the order.

Index. jsp
Index.html
Index.htm
Default.html
Default.htm
Default. jsp

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.