Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 Tomcat 配置集锦
chengbd



版主


发贴: 687
于 2005-03-10 18:58 user profilesend a private message to usersend email to chengbdreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
配置问题大家经常遇到,欢迎各位跟帖

Tomcat 服务器server.xml的关键参数配置

说明:以下文字均以tomcat5.0.30为例进行。

1,配置tomcat服务器访问端口,只需配置Connector的port端口即可。Tomcat默认为8080,现修改port参数值为80。

<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->

<Connector port="80"

maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

enableLookups="false" redirectPort="8443" acceptCount="100"

debug="0" connectionTimeout="20000"

disableUploadTimeout="true" URIEncoding="GBK"/>

2,配置tomcat支持URL中文参数,只需添加Connector的URIEncoding参数即可,默认情况下该参数未被配置。要支持URL参数支持中文,加上URIEncoding=”GBK”就行了(见1中附代码最后一行)。


3,配置新的webApp:找到host尾标记</Host>,插入新的context即可。
如:
(1)<Context path="" docBase="ROOT" debug="0"/>
若要支持数据库(以SQL Server为例),则为:
(2)<Context path="/xkb" docBase="F:\XKB6\webApp" debug="5" reloadable="true" crossContext="true">

<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_DBTest_log." suffix=".txt" timestamp="true"/>

<Resource name="jdbc/SqlServerDB" auth="Container" type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/SqlServerDB">

<parameter>

<name>factory</name>

<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>

</parameter>

<!-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit.-->

<parameter>

<name>maxActive</name>

<value>50</value>

</parameter>

<!-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit.-->

<parameter>

<name>maxIdle</name>

<value>20</value>

</parameter>

<!-- Maximum time to wait for a dB connection to become available in ms, in this example 0.5 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -->

<parameter>

<name>maxWait</name>

<value>500</value>

</parameter>

<!-- msSQL dB username and password for dB connections -->

<parameter>

<name>username</name>

<value>sa</value>

</parameter>



<parameter>

<name>password</name>

<value>wangnewton</value>

</parameter>

<!-- Class name for SQLServer2000 JDBC driver -->

<parameter>

<name>driverClassName</name>

<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>

</parameter>

<!-- The JDBC connection url for connecting to your MS SQL Server dB.The autoReconnect=true argument to the url makes sure that the mm.Sql Server JDBC Driver will automatically reconnect if mysqld closed the connection. mysqld by default closes idle connections after 8 hours.-->

<parameter>

<name>url</name>

<value>jdbc:microsoft:sqlserver://localhost:1433;databaseName=XKBCourse</value>

<!--must use & not use & -->

</parameter>

</ResourceParams>

</Context>




话题树型展开
人气 标题 作者 字数 发贴时间
34980 Tomcat 配置集锦 chengbd 3146 2005-03-10 18:58
32032 Tomcat 5.5.x 配置集锦(x表示4,5,.6,7) 选择自 CSDN chengbd 6824 2005-03-10 18:59
32512 Re:Tomcat 5.5.x 配置集锦(x表示4,5,.6,7) 选择自 CSDN的szmarx 的 Blog bluepure 3698 2005-03-10 19:16
31257 Re:Tomcat 配置集锦 seamaid 23 2005-07-30 13:48
31259 Re:Tomcat 配置集锦 hyhking 4 2005-08-18 14:00
31105 Re:Tomcat 配置集锦 chengbd 29 2005-08-19 02:10
31110 Re:Tomcat 配置集锦 343582958 6 2005-08-20 08:49
31400 Re:Tomcat 配置集锦 gaohuawei 18 2005-08-24 19:24
31372 Re:Tomcat 配置集锦 scriptlets 59162 2005-09-15 11:42
30828 Re:Tomcat 配置集锦 deifrgw 4 2005-10-27 10:23
30627 Re:Tomcat 配置集锦 verwa 4 2005-12-14 00:11
30439 Re:Tomcat 配置集锦 zjh1983314 9 2005-12-14 13:08
30387 Re:Tomcat 配置集锦 cwnuth 45 2006-01-17 22:57
33033 Tomcat中文编码问题解决方案(简) chengbd 2482 2005-03-10 19:03
30277 Re:Tomcat 配置集锦 蓝薇 5 2006-02-11 11:05
30111 Re:Tomcat 配置集锦 xiaozhao532 4 2006-03-14 08:16
29980 Re:Tomcat 配置集锦 风雨断肠人 21 2006-04-11 13:06
29977 tomcat+jsp经典配置 huchao60 86 2006-04-26 16:44
29854 Re:Tomcat 配置集锦 180onwarding 40 2006-04-27 10:41
30018 Re:Tomcat 配置集锦 180onwarding 4832 2006-04-27 14:42
29851 Re:Tomcat 配置集锦 langhua983 41 2006-05-15 00:58
29849 Re:Tomcat 配置集锦 shgshg 24 2006-06-05 14:17
29552 Re:Tomcat 配置集锦 LeadenSky 4 2006-08-02 13:37
29244 Re:Tomcat 配置集锦 q_yuan 21 2006-10-19 12:54
31755 Re:Tomcat 配置集锦 chengbd 54 2005-03-11 00:28
31629 Re:Tomcat 配置集锦 echofang 10 2005-04-16 20:54
29378 Re:Tomcat 配置集锦 wl820609 10 2006-12-05 16:28
32138 Re:Tomcat 配置集锦 yjg2008 34 2007-02-01 13:18
31656 Re:Tomcat 配置集锦 ccic134302 2 2005-03-19 12:06
31758 Re:Tomcat 配置集锦 zouhuiming 7 2005-03-19 12:40
31794 tomcat+jsp经典配置 chengbd 12625 2005-05-01 01:03
30096 Re:tomcat+jsp经典配置 huchao60 17 2006-04-26 16:41
31656 Re:Tomcat 配置集锦 等你 217 2005-05-02 18:29
31496 Re:Tomcat 配置集锦 henbane 67 2005-06-02 18:56
31277 Re:Tomcat 配置集锦 flyingis 10 2005-07-13 18:24

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2018 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号
客服电话 0592-8750026    客服信箱 714923@qq.com    客服QQ 714923