Some configuration instructions in Tomcat
Set the environment variable Linux system, modify catalina.sh and catalina.50.shjava_home = / usr / local / j2sdk1.4.2_06java_opts = '- XMS512M -XMX512M'CataLina_Home = / usr / local / jakarta-tomcat-5.0.28windows system, modification Catalina.bat and catalina.50.batset java_home = d: /j2sdk1.4.2_06set catalina_home = d: /jakarta-tomcat-5.0.281. How to increase Tomcat connections in  in Tomcat configuration file server.xml In the configuration, and the number of connections is: minprocessors: minimum idle connection thread, used to improve system processing performance, the default value is 10maxProcessors: maximum connection thread, the maximum number of requests, the maximum number of requests, the default is 75Acceptcount: The maximum number of connections, should be greater than or equal to MAXPROCESSORS, the default value is 100NableLookups: whether the domain name is reversed, and the value is: True or False. In order to improve processing power, it should be set to falseConnectionTimeout: Network connection timeout, unit: milliseconds. Set to 0 indicates that never timeout, this is set to have hidden dangers. It is usually set to 30000 milliseconds. The parameters related to the maximum number of connections are MaxProcessors and AcceptCount. If you want to increase the number of concurrent connections, you should increase these two parameters. The maximum number of web services allowed is also subject to the operating system's kernel parameter setting, usually Windows is about 2,000, Linux is about 1000. Configuration example tomcat5 of:  is pushed by listening to other ports. 2. How to prohibit the files in the column directory in Tomcat in {Tomcat_Home} /conf/web.xml, set the listings parameter to false, as follows:   Listings  param-name >  false  param-value>  init-param> 3. How to increase Tomcat's memory tomcat default can be used by 128MB, in larger application items, this memory is Not enough, it needs to be protected.
Under UNIX, in front of the file {tomcat_home} /bin/catalina.sh, add the following settings: java_opts = '- XMS [Initialization Memory Size] -XMX [The maximum memory you can use] "Need to turn this two parameter values . For example: java_opts = '- XMS256M -XMX512M' indicates that initialization memory is 256MB, and the maximum memory can be used for 512MB 4. How to add the default access page to modify the file web.xml, add the page you want to add in Welcome-File.   index.html  welcome-file>  index.htm  welcome-file>  index.jsp  welcome-file>  < / Welcome-file-list> 5. How to add an error page Modify file web.xml, add an error page in Location   404  Error-Code>  / error.jsp < / Location>  error-page>   500  error-code>  / error.jsp  location>  error-page>
Modify the file web.xml, add an error page in Location   404  Error-Code>  / error.jsp  location>  error-page>   500  Error-Code>  / error.jsp  location>  error-page>
6. How to configure a virtual host to modify the file server.xml to implement a domain name (IP address), add the following:   www.test1.com  alias>  192.168.1.110  alias>  host>   www.test2.com  alias>  192.168 .120  alias>  host> Create a folder in the conf / catalina / directory, the name of the folder is "www.test1.com" and "www.test2.com" and then established in these two directories. File root.xml, its "www.test1.com" directory root.xml content is:  XML Version = '1.0' encoding = 'utf-8'?>    
 Context> 7. How to configure the MySQL data source to establish a database TEST in this unit, copy mysql's JDBC Drive MySQL-Connector-Java-3.0.9-Stable-bin.jar to the directory common / lib, modify the file web. XML, add the following:   mysql Datasource Example  description>  JDBC / TEST  RES-REF-NAME>  javax.sql.datasource < / Res-type>  Container  res-auth>  resource-ref> Add the following in the configuration file of the web application:     factory  name>  org.apache.commons.dbcp.basicDataSourceFactory  value>  parameter>    driverclassname  name>  org.gjt.mm.mysql.driver  value>  parameter>    URL  name>  jdbc: mysql: // localhost: 3306 / test? AutoreConnect = true  value>  parameter>    Username  name>  root  value>  parameter>   password  name>   value>  parameter> <