`
knight_black_bob
  • 浏览: 841836 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

tomcat 页面图片 管理 服务器 配置

阅读更多

 

 

1、tomcatserver.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 more
  contributor license agreements.  See the NOTICE file distributed with
  this 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 with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed 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 and
  limitations under the License.
--><!-- Note:  A "Server" is not itself a "Container", so you may not
     define 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 resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm 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 share
       a 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 received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define 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 8443
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described 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 processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on 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 passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available 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 applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: 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捐助),没钱捧个人场,谢谢各位。



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

 

 

  • 大小: 17.7 KB
1
2
分享到:
评论
2 楼 knight_black_bob 2015-09-20  
bfttt999 写道
似乎说了半天也没有跟页面图片服务器有啥关系,也就URIEncoding解决中文路径和参数的问题,看标题还真以为什么高大上呢。

http://knight-black-bob.iteye.com/blog/2244731
1 楼 bfttt999 2015-08-18  
似乎说了半天也没有跟页面图片服务器有啥关系,也就URIEncoding解决中文路径和参数的问题,看标题还真以为什么高大上呢。

相关推荐

    Tomcat服务器配置教程

    ### Tomcat服务器配置教程 #### 一、Tomcat服务器环境配置 在开始配置Tomcat服务器之前,我们需要确保已经正确安装了Java环境,并且设置了相关的环境变量。以下将详细介绍如何进行这些配置。 ##### 1. 设置环境...

    服务器集群配置方法_tomcat

    【服务器集群配置方法_tomcat】的描述涉及到了在IT领域中常见的服务器集群技术,特别是如何使用Apache HTTP Server和Tomcat应用服务器实现负载均衡。以下是详细的步骤和知识点解析: 1. **服务器集群环境**: - ...

    Linux环境下配置Tomcat服务器

    Linux 环境下配置 Tomcat 服务器 在 Linux 环境下配置 Tomcat 服务器是非常重要的,因为 Tomcat 是一个轻量级应用服务器,广泛应用于中小型系统和并发访问用户不是很多的场合。下面我们将详细介绍 Linux 环境下配置...

    myeclipse配置tomcat服务器

    ### MyEclipse配置Tomcat服务器详解 在深入探讨如何在MyEclipse中配置Tomcat服务器之前,让我们首先理解几个核心概念及其相互关系。MyEclipse、Tomcat以及JDK是构建Web应用程序时不可或缺的三个组件。 #### ...

    MyEclipse10配置Tomcat

    在 MyEclipse 10 中配置 Tomcat 服务器的第一步骤是打开服务器管理对话框。用户可以通过两种方法打开对话框:一是直接在工具条中点击 Servers 按钮,二是从菜单中选择 Servers &gt; Add Server。无论哪种方法,都将打开...

    tomcat7本地服务器

    在Java开发中,Tomcat7作为轻量级服务器,其主要优点包括低资源消耗、易于配置和管理。对于初学者和小型团队来说,它是理想的开发环境,因为它不需要像大型应用服务器那样复杂的设置和管理。在本地计算机上搭建...

    Tomcat8.0 适用小型服务器

    6. **配置与管理**:Tomcat的配置主要通过`conf`目录下的文件进行,例如`server.xml`用于配置服务器的整体结构,`web.xml`定义Web应用的行为。管理员可以通过修改这些文件来定制Tomcat的行为。 7. **安全性**:...

    tomcat5.5通用配置(管理页面已经配置好)

    《Tomcat 5.5 通用配置及其管理页面详解》 Tomcat 5.5 是一个广泛使用的开源Java Servlet容器,它实现了Java EE Web应用程序的Servlet和JSP规范。在这个版本中,Tomcat以其轻量级、高效和稳定性的特点赢得了开发者...

    Tomcat服务器配置详细步骤及常见错误总结

    ### Tomcat服务器配置详细步骤及常见错误总结 #### 一、Tomcat服务器配置步骤 **1. 设置JAVA_HOME环境变量** - 打开计算机属性页面,点击“高级系统设置”。 - 在弹出的对话框中选择“环境变量”。 - 在系统变量...

    JSP环境配置(用Tomcat做服务器)

    **JSP环境配置指南——基于Tomcat服务器** JavaServer Pages(JSP)是一种动态网页技术,它允许开发者在HTML页面中嵌入Java代码,从而实现动态网页的生成。配置JSP开发环境通常需要一个Web服务器,如Apache Tomcat...

    以Tomcat服务器为核心的3种配置JSP环境.,tomcat的配置

    在IT行业中,JSP(JavaServer Pages)是一种用于...总之,配置以Tomcat为核心的JSP环境需要理解Tomcat的工作原理,熟悉服务器配置文件,以及掌握IDE或构建工具的使用。通过以上步骤,你应该能够成功搭建并管理JSP应用。

    tomcat6.0.20服务器及配置方法

    7. **日志和错误管理**:Tomcat的日志文件位于`logs`目录下,包括`catalina.out`、`host-manager`、`manager`等,这些文件记录了服务器运行过程中的各种信息,对于调试和故障排查非常有用。 在"tomcat6的配置含视频...

    使用Tomcat配置域名

    在实际操作中,你可能还需要根据具体需求进行其他配置,如调整连接器参数、设置会话管理、配置错误页面等。在处理多域名时,确保每个`&lt;Host&gt;`元素都有其独特的`name`属性,这样Tomcat才能正确地将请求路由到相应的...

    给tomcat 服务器配置域名

    以下是一个详细的步骤指南,帮助你了解如何为Tomcat服务器配置域名。 首先,你需要拥有一个已注册的域名,例如example.com。这个域名需要指向你的服务器IP地址,这通常通过DNS(域名系统)设置完成。在你的域名注册...

    apache+tomcat集群配置

    本文将详细介绍如何配置 Apache + Tomcat 集群,包括安装 Apache 和 Tomcat 服务器、配置 mod_jk 模块、配置 Apache 和 Tomcat 服务器、配置负载均衡控制器等。 一、安装 Apache 服务器 首先,需要安装 Apache ...

    Tomcat服务器配置

    ### Tomcat服务器配置详解 #### 一、Tomcat简介及特点 Tomcat是一个开源的Java Servlet容器,由Apache软件基金会的Jakarta项目开发。它主要用作开发和部署基于Java的Web应用程序,支持Servlet和JavaServer Pages ...

    tomcat-6.0.37(服务器版本)

    5. **配置管理**:Tomcat 6提供了更灵活的配置方式,如通过XML配置文件调整服务器设置,或者通过web管理界面进行远程管理。`conf`目录下的文件,如server.xml、web.xml等,是主要的配置文件。 6. **部署与管理**:...

Global site tag (gtag.js) - Google Analytics