谁有tomcat权威指南中文版电子书籍? ( 积分: 100 )

  • 主题发起人 主题发起人 immediately
  • 开始时间 开始时间
I

immediately

Unregistered / Unconfirmed
GUEST, unregistred user!
谁有tomcat权威指南中文版电子书籍?
谢谢。。
 
谁有tomcat权威指南中文版电子书籍?
谢谢。。
 
好像没有
 
http://www.js.lss.gov.cn:7001/jsyb/SIHis/Tomcat 配置集锦.txt (中文)
http://www.js.lss.gov.cn:7001/jsyb/SIHis/Tomcat (rus).pdf (E文)
 
楼上怎么访问。好像不行
 
Tomcat 配置集锦
1.下载http://www.eu.apache.org/dist/jakarta/tomcat-5/
这里注意,在jakarta-tomcat-5.0.28.exe以前是有默认的admin模块,在jakarta-tomcat-5.5.9.exe则没有安装默认的admin模块,这时http://127.0.0.1:8080/admin打开时则会出现
Tomcat's administration web application is no longer installed by default.do
wnload and install the "admin"
package to use it.
因此我们现在需要下载"admin"package 包
把jakarta-tomcat-5.5.x.zip 与 jakarta-tomcat-5.5.x-compat.zip 与 jakarta-tomcat-5.5.x-admin.zip
三个文件解压在同一个目录中
(如果使用jdk1.4,才需要compat.zip用jdk1.5就可以免了这个。)


2.修改jakarta-tomcat-5.5.x/conf/tomcat-users.xml.
添加管理员账号lizongbo,密码为lizongbopass.
新xml如下:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename=&quot;tomcat&quot;/>
<role rolename=&quot;role1&quot;/>
<role rolename=&quot;manager&quot;/>
<role rolename=&quot;admin&quot;/>
<user username=&quot;tomcat&quot;
password=&quot;tomcat&quot;
roles=&quot;tomcat&quot;/>
<user username=&quot;role1&quot;
password=&quot;tomcat&quot;
roles=&quot;role1&quot;/>
<user username=&quot;both&quot;
password=&quot;tomcat&quot;
roles=&quot;tomcat,role1&quot;/>
<user username=&quot;lizongbo&quot;
password=&quot;lizongbopass&quot;
roles=&quot;admin,manager&quot;/>
</tomcat-users>

有时在%CATALINA_HOME%/server/webapps/admin/WEB-INF/web.xml里面也要做些修改

<!-- Security is active on entire directory -->
<security-constraint>
<display-name>Tomcat Server Configuration Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.do</url-pattern>
<url-pattern>*.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area -->
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<!-- Login configuration uses form-based authen
tication -->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Tomcat Server Configuration Form-Based Authen
tication Area</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<description>
The role that is required to log in to the Administration Application
</description>
<role-name>admin</role-name>
</security-role>
无论是 Authetication ( 身份验证 还是 Authorization ( 权限管控 都只有设置相关的 admin ROLE, 当你想要新增或修改相关的 AA, 就必须修改这一个文件, 来符合你的环境.
3.修改jakarta-tomcat-5.5.x/conf/server.xml来解决编码问题。
(给Connector 添加URIEncoding参数,参考http://blog.csdn.net/darkxie/archive/2004/10/25/TOMCATAPP.aspx)
(可以设置成GB18030)
<Connector port=&quot;8080&quot;
maxThreads=&quot;150&quot;
minSpareThreads=&quot;25&quot;
maxSpareThreads=&quot;75&quot;
enableLookups=&quot;false&quot;
redirectPort=&quot;8443&quot;
acceptCount=&quot;200&quot;
connectionTimeout=&quot;20000&quot;
disableUploadTimeout=&quot;true&quot;
URIEncoding=&quot;GBK&quot;
compression=&quot;on&quot;
compressionMinSize=&quot;2048&quot;
noCompressionUserAgents=&quot;gozilla, traviata&quot;
compressableMimeType=&quot;text/html,text/xml&quot;/>

<Connector port=&quot;8009&quot;
enableLookups=&quot;false&quot;
redirectPort=&quot;8443&quot;
protocol=&quot;AJP/1.3&quot;
URIEncoding=&quot;GBK&quot;/>

4.启用支持gzip压缩.
(http://www.linuxaid.com.cn/forum/showdoc.jsp?l=1&amp;i=81169)
添加下列属性
compression=&quot;on&quot;
compressionMinSize=&quot;2048&quot;
noCompressionUserAgents=&quot;gozilla, traviata&quot;
compressableMimeType=&quot;text/html,text/xml&quot;

5.设置虚拟主机。
在jakarta-tomcat-5.5.x/下建立文件夹vhost/www.mydomain.com。
然后修改jakarta-tomcat-5.5.x/conf/server.xml

<Engine defaultHost=&quot;localhost&quot;
name=&quot;Catalina&quot;>
<Host appBase=&quot;vhost/www.mydomain.com&quot;
name=&quot;http://www.mydomain.com/&quot;>
</Host>
<Host appBase=&quot;webapps&quot;
name=&quot;localhost&quot;>
</Host>
<Realm className=&quot;org.apache.catalina.realm.UserDatabaseRealm&quot;/>
</Engine>

6.添加数据库驱动,更新mail.jar和actiovation.jar
复制mysql-connector-java-3.0.16-ga-bin.jar,pg74.215.jdbc3.jar到 jakarta-tomcat-5.5.x/common/lib/
还有javamail 1.3.2的mail.jar,jaf-1_0_2的 activation.jar
msSQl 2000 JDBC sp3,msbase.jar,msutil,jar,mssqlserver.jar


7.配置SSL
参考 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
输入keystore密码: lizongbossl
您的名字与姓氏是什么?
[tomcat5.5.x]: tomcat5.5.x
您的组织单位名称是什么?
[jakarta]: jakarta
您的组织名称是什么?
[apache]: apache
您所在的城市或区域名称是什么?
[hzcity]: hzcity
您所在的州或省份名称是什么?
[gdp]: gdp
该单位的两字母国家代码是什么
[CN]: CN
CN=tomcat5.5.x, OU=jakarta, O=apache, L=hzcity, ST=gdp, C=CN 正确吗?
[否]: y

输入<tomcat>的主密码
(如果和 keystore 密码相同,按回车):
(必须密码一致,因此直接回车)
然后再把userhome(例如:C:/Documents and Settings/lizongbo/)下的.keystore复制到
tomcat的conf/目录下。
(例如:D:/jakarta-tomcat-5.5.x/conf/.keystore
配置jakarta-tomcat-5.5.x/conf/server.xml
加上
<Connector port=&quot;8443&quot;
maxThreads=&quot;150&quot;
minSpareThreads=&quot;25&quot;
maxSpareThreads=&quot;75&quot;
enableLookups=&quot;false&quot;
disableUploadTimeout=&quot;true&quot;
acceptCount=&quot;100&quot;
scheme=&quot;https&quot;
secure=&quot;true&quot;
clientAuth=&quot;false&quot;
sslProtocol=&quot;TLS&quot;
keystoreFile=&quot;conf/.keystore&quot;
keystorePass=&quot;lizongbossl&quot;> <!--与先前设置的密码一致-->
</Connector>
8.禁止文件目录列表,
修改jakarta-tomcat-5.5.x/conf/web.xml,把listing设置为false

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

9.指定了自己的javaEncoding
(参考 http://gceclub.sun.com.cn/staticcontent/html/sunone/app7/app7-dg-webapp/ch6/ch6-4.html
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>javaEncoding</param-name>
<param-value>GB18030</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
10.添加rar,iso等的mime-type映射
避免在浏览器里直接打开。
<mime-mapping>
<extension>mht</extension>
<mime-type>text/x-mht</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rar</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>iso</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ape</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>rmvb</extension>
<mime-type>application/octet-stream</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ico</extension>
<mime-type>image/x-icon</mime-type>
</mime-mapping>
10.1对html静态页面设置编码
<!-- 修改下面两行以支持静态超文本的自动编码
-->
<mime-mapping>
<extension>htm</extension>
<mime-type>text/html;charset=gb2312</mime-type>
</mime-mapping>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html;charset=gb2312</mime-type>
</mime-mapping>
</web-app>

11.添加welcome-file-list,并调整顺序。
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
 
仁兄,谢谢。正需要呢
 
多谢了。。结贴了。。
 

Similar threads

D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
535
import
I
I
回复
0
查看
831
import
I
后退
顶部