1、在tomcat的server.xml配置文件中设置docBase:需要写在Value标签下面,如下:

<Context docBase="/opt/traceupload/upload" path="/upload"></Context>

1、需要在服务器上手动创建文件夹base路径:opt/traceupload/upload文件夹。

2、在server.xml中配置URIEncoding="UTF-8",解决<img>标签的src属性不兼容中文的图片名称,配置如下:

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>

<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--><!-- Note:  A "Server" is not itself a "Container", so you may notdefine subcomponents such as "Valves" at this level.Documentation at /docs/config/server.html--><Server port="8005" shutdown="SHUTDOWN"><!-- Security listener. Documentation at /docs/config/listeners.html<Listener className="org.apache.catalina.security.SecurityListener" />--><!--APR library loader. Documentation at /docs/apr.html --><Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/><!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --><Listener className="org.apache.catalina.core.JasperListener"/><!-- Prevent memory leaks due to use of particular java/javax APIs--><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/><!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--><GlobalNamingResources><!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--><Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/></GlobalNamingResources><!-- A "Service" is a collection of one or more "Connectors" that sharea single "Container" Note:  A "Service" is not itself a "Container",so you may not define subcomponents such as "Valves" at this level.Documentation at /docs/config/service.html--><Service name="Catalina"><!--The connectors can use a shared executor, you can define one or more named thread pools--><!--<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"maxThreads="150" minSpareThreads="4"/>--><!-- A "Connector" represents an endpoint by which requests are receivedand responses are returned. Documentation at :Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)Java AJP  Connector: /docs/config/ajp.htmlAPR (HTTP/AJP) Connector: /docs/apr.htmlDefine a non-SSL HTTP/1.1 Connector on port 8080--><Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/><!-- A "Connector" using the shared thread pool--><!--<Connector executor="tomcatThreadPool"port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443" />--><!-- Define a SSL HTTP/1.1 Connector on port 8443This connector uses the JSSE configuration, when using APR, theconnector should be using the OpenSSL style configurationdescribed in the APR documentation --><!--<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"maxThreads="150" scheme="https" secure="true"clientAuth="false" sslProtocol="TLS" />--><!-- Define an AJP 1.3 Connector on port 8009 --><Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/><!-- An Engine represents the entry point (within Catalina) that processesevery request.  The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --><!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">--><Engine defaultHost="localhost" name="Catalina"><!--For clustering, please take a look at documentation at:/docs/cluster-howto.html  (simple how to)/docs/config/cluster.html (reference documentation) --><!--<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>--><!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --><Realm className="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase".  Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm.  --><Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/></Realm><Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"><!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --><!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />--><!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using pattern="common" --><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/><Context docBase="/opt/traceupload/upload" path="/upload"></Context><Context docBase="TRACE_WEB" path="/TRACE_WEB" reloadable="true" source="org.eclipse.jst.jee.server:TRACE_WEB"/><Context docBase="TRACEDataEngine3.0" path="/TRACEDataEngine" reloadable="true" source="org.eclipse.jst.jee.server:TRACEDataEngine3.0"/><Context docBase="TRACEProbeServiceMaster" path="/TRACEProbeService" reloadable="true" source="org.eclipse.jst.jee.server:TRACEProbeServiceMaster"/></Host></Engine></Service>
</Server>

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。


 
 
 谢谢您的赞助,我会做的更好!

tomcat 页面图片 管理 服务器 配置相关推荐

  1. 直接访问静态图片_详解nginx和tomcat访问图片和静态页面的配置方法

    概述 生产环境下,有时候需要访问图片,正常需要应用ftp.nginx等配套使用,但是有时候为了简化,可以用以下的两种简单的访问,说实话,就是为了偷懒,但是效果是能有的,这就行了,所以今天做这个简化版的 ...

  2. 百度ueditor富文本--图片保存路径的配置以及上传到远程服务器

    我们在上篇文章中学习了  上传图片的配置: 百度ueditor富文本--配置图片上传 在文章的最后 讲到  ueditor 默认设置的 保存图片的 路径 是相对路径,项目相关的. 保存的图片会放在to ...

  3. tomcat提高图片服务器性能,Tomcat性能调优(windows)

    1.目录: a.基础调优 b.JVM 优化 c.高级调优 2.基础调优: 2.1.tomcat的各版本的优化参数有点不一样,可以启动tomcat之后访问[http://127.0.0.1:8080/d ...

  4. 使用tomcat做图片服务器

    使用tomcat做图片服务器的的目的 主要是因为项目小,暂时不需要大的解决方案,在就是避免频繁的更新导致的图片等数据文件的备份留存问题. 除了可以使用tomcat做图片服务器之外,同样也可以使用tom ...

  5. jsp+php 服务器环境,Windows下Apache+Tomcat+jsp+php的服务器整合配置

    具体配置参照 Windows下Apache+Tomcat+jsp+php的服务器整合配置出现Service Unavailable错误 Service Unavailable The server i ...

  6. 视频监控系统的管理服务器,视频监控中管理服务器的配置

    视频监控中管理服务器的配置 内容精选 换一换 此章节主要介绍SAP应用弹性伸缩和其他服务之间的关系. 对于非企业管理服务模板创建的资源,如果需要使用企业管理服务的功能,如应用监控.备份恢复,可通过纳管 ...

  7. vnc远程控制软件配置,如何配置vnc远程控制软件实现批量管理服务器

    应该有不少小伙伴在日常工作过程中,都会有关于vnc远程控制软件配置的困扰吧.下载好了软件,却不知道如何使用.那你对vnc远程控制软件配置了解多少呢?又是如何配置vnc远程控制软件实现批量管理服务器的呢 ...

  8. win7信息服务器iis管理器,win7iis管理器配置web服务器

    win7iis管理器配置web服务器 内容精选 换一换 代码迁移工具进行代码迁移时,需要调用Linux下的rpm.deb等命令才能完成扫描和迁移相关任务,这些命令和逻辑必须在后端Linux运行.IDE ...

  9. java web 默认页面配置文件_Tomcat中配置全局的错误页面(如404)+删除Tomcat中webapps目录下的自带项目,防止Tomcat默认文件泄露...

    进入tomcat目录中conf文件编辑web.xml,将下面代码复制到文件末尾,如下 400 /error.html 404 /404/404.html 500 /404/500.html 2.添加4 ...

最新文章

  1. linux启动x不启动桌面,redhat开机不启动桌面登录程序
  2. k-d tree树 近邻算法
  3. 聊聊底线 | 坏数据与假数据
  4. shell脚本实战 pdf_Shell脚本实战:日志关键字监控+自动告警
  5. android连接ecs sql server_MySQL 执行 SQL 语句的过程解析
  6. 电脑内部,小贴士:电脑内部连接标准
  7. 还需要更多东西吗?这里有一些要做的事情
  8. linux快速删除大文件rsync,(总结)Linux下使用rsync最快速删除海量文件的方法
  9. Javaweb基础-SQL增删改查
  10. theano java_Windows Theano GPU 版配置
  11. 当自己觉得特别迷茫的时候,是怎么走出这个困境的
  12. 如何做一个炫酷的墨水屏电子钟?
  13. word制作流程图有没有橡皮擦_WORD文档绘图,里面的橡皮擦在哪里啊
  14. 2016计算机技术操作考试题,2016年计算机二级《VB》上机操作题(1)
  15. 10064---JVM GC 机制与性能优化
  16. 浪潮服务器u盘安装系统_浪潮服务器U盘安装系统无法识别到电脑硬题的解决
  17. 业务员应熟记的应酬劝酒词大全
  18. 关联分析(Apriori,FP-growth)
  19. 阿里云网站备案与域名解析操作流程
  20. 大数据产业驱动智慧家庭发展

热门文章

  1. 安卓代码迁移:Make.exe: *** [***.o]Error 1
  2. 英语怎么说_日常英语怎么说
  3. [译]Hour 7 Teach.Yourself.WPF.in.24.Hours
  4. SSM框架下log4j的配置和使用
  5. 数据之路 Day5 - Python基础5
  6. Xcode 自带单元测试
  7. MongoDB日志文件过大
  8. 你真的在正确地使用WLAN控制器吗?
  9. Lucene系列:(9)搜索结果排序
  10. 求最大子段和的一些算法