tomcat,tomcat笔记

java_home(架设tomcat必设,否则启动时一闪而过)
c:\jdk1.6
path
%java_home%\bin
classpath
.;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
https 443
smtp 25
pop3 110
修改默认端口
修改C:\apache-tomcat-6.0.20\conf\server.xml文件中Connector标签的port属性值
<Connector port="8080" ... 修改端口
虚拟目录
方法一:(常用方法,不需要重启tomcat)
In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. The default web application may be defined by using a file called ROOT.xml.
C:\apache-tomcat-6.0.20\conf\Catalina\localhost目录下新建文件
test3.xml
<Context docBase="c:\test3"/>
http://www.aa.com/test3/
test#test4.xml
<Context docBase="c:\test4"/>
http://www.aa.com/test/test4/
ROOT.xml(需要重启tomcat)
<Context docBase="c:\test5"/>
http://www.aa.com/
方法二:(需要重新启动tomcat)
<Host name="localhost" ...>
<Context path="/test" docBase="c:\test2"/>
<!--
http://www.aa.com/test/
path=""时 http://www.aa.com/
-->
</Host>
方法三:
Only if a context file does not exist for the application in the $CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the application's context path. _disibledevent=>
<Context path="" docBase="c:\test6"/>
</Host>
http://www.bb.com/news/
<Host name="www.bb.com" appBase="c:\test7">
<Context path="/news" docBase="c:\test7\test"/>
</Host>
本地DNS解析
配置C:\WINDOWS\system32\drivers\etc\hosts文件
127.0.0.1 www.aa.com
web应用打包
dos运行下
jar -cvf mail.war mail
Tomcat的体系结构和配置https连接器 公钥 私钥
dos运行下
keytool -genkey -alias tomcat -keyalg RSA
密钥的生成路径
C:\Documents and Settings\username
文件名:.keystore
将此文件拷贝到C:\apache-tomcat-6.0.20\conf文件夹下
配置server.xml文件中
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="conf/.keystore" keystorePass="caiqing520" />
Tags:  tomcat下载 tomcat配置 tomcat

延伸阅读

最新评论

发表评论