tomcat相关配置
来源:互联网 发布:linux shell脚本 等待 编辑:程序博客网 时间:2024/05/16 12:31
1 GET方式URL字符集配置
在${TOMCAT_HOME}/conf/server.xml添加URIEncoding="UTF-8"
配置如下:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
2 虚拟目录配置
${TOMCAT_HOME}/conf/server.xml更改配置如下
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="/tathing-portal/uploadImg" docBase="D:\UserImg" reloadable="true" debug="0"/><Context path="/cms/userfiles/images" docBase="/home/cmsImg/images" reloadable="true" debug="0"/> <Context path="/cms/userfiles/files" docBase="/home/cmsImg/files" reloadable="true" debug="0"/>
注:虚拟目录可配置多个,如上图蓝色内容所示。系统上传的附件等,存放在D:\UserImg,建立虚拟目录指定到webapps中的某个目录,这样系统就可以访问当其他磁盘中的文件。
3 Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee
在tomcat 的bin目录下 执行这条命令
chmod +x *.sh
再次执行 sh catalina.sh通过,
4 tomcat环境准备
清理掉webapps中红色方框中的除ROOT外的所有文件
否则使用WVS将扫描出以下结果
5 CA证书安装
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="c:\tomcat1.jks" keystorePass="password" clientAuth="false" sslProtocol="SSLv3" ciphers="SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA"/>
6 tomcat集群redis方案
${TOMCAT_HOME}/conf/context.xml更改配置如下蓝色字体所示,其中10.8.40.230为redis服务器的ip
<Context> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Loader delegate="true" /> <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /> <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" host="10.8.40.230" port="6379" database="0" maxInactiveInterval="60" /> ```将下放四个jar包放入到${TOMCAT_HOME}/lib中**7 启用tomcat的jmx**在catalina.sh中加 JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=192.168.5.125 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9109 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"**8 linux环境下开机启动tomcat**[linux教程:[4]配置Tomcat开机启动](http://jingyan.baidu.com/article/6525d4b1382f0aac7d2e9421.html),核心配置如下: #chkconfig: 2345 80 90 #description:tomcat auto start #processname: tomcat8_1 export CATALINA_BASE=/usr/local/application/tomcat8_1 export CATALINA_HOME=/usr/local/application/tomcat8_1 export CATALINA_TMPDIR=/usr/local/application/tomcat8_1 ln -s /usr/local/application/tomcat8_1/bin/startup.sh /etc/rc.d/init.d/tomcat8_1 chkconfig --add tomcat8_1
9 去掉工程名访问
更改server.xml
<Context path="" docBase="/sns" debug="0"/>
10 eclipse远程调试tomcat
Java编程经验——怎样用eclipse进行远程debug
tomcat默认远程调试端口是 8000
按照百度经验中的配置会有一些问题,所以需要做如下处理,跟iptables有没有关闭没有关系。
可在linux中tomcat的bin目录下找到catalina.sh添加
CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
重启tomcat,发现catalina.out中出现Listening for transport dt_socket at address: 8000
,则可以远程调试了。
11 tomcat内存设置
参考Tomcat中JVM内存溢出及合理配置
- tomcat相关配置
- Tomcat配置相关问题
- tomcat相关配置
- tomcat 相关配置
- nginx+tomcat 配置相关
- Tomcat的相关配置
- Tomcat相关配置
- Tomcat 相关配置
- Tomcat相关配置
- tomcat相关配置
- tomcat服务器相关配置
- Tomcat的相关配置
- tomcat相关配置
- Tomcat相关配置
- tomcat相关配置
- tomcat相关配置
- 第四天:tomcat相关配置
- Tomcat高并发相关配置
- addEventListener() 方法
- svn常用命令详解
- u-boot启动流程简图
- Xposed模块之抢红包
- Eclipse报错:[SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.serv
- tomcat相关配置
- Quartz学习——Spring和Quartz集成详解(三)
- c语言之顺序表
- 第13期《梦,一直在进行》2月刊
- Android中使用百度地图时定位到当前位置遇到的问题
- 文件的上传下载
- 调试公司eap框架问题
- android沉浸式状态栏的实现
- Mybatis学习笔记(一):入门