Some configuration instructions in Tomcat

xiaoxiao2021-03-06  42

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 false 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 index.htm index.jsp < / Welcome-file-list> 5. How to add an error page Modify file web.xml, add an error page in Location 404 / error.jsp < / Location> 500 / error.jsp

Modify the file web.xml, add an error page in Location 404 / error.jsp 500 / error.jsp

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 192.168.1.110 www.test2.com 192.168 .120 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:

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 JDBC / TEST javax.sql.datasource < / Res-type> Container Add the following in the configuration file of the web application: factory org.apache.commons.dbcp.basicDataSourceFactory driverclassname org.gjt.mm.mysql.driver URL jdbc: mysql: // localhost: 3306 / test? AutoreConnect = true Username root password <

转载请注明原文地址:https://www.9cbs.com/read-72839.html

New Post(0)