tomcate端口设定和服务器虚拟目录设定

 

设定端口和  虚拟目录

在server.xml

<?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">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--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" />
  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- 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 name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </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 port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               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 name="Catalina" defaultHost="localhost">

      <!--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"/>
      -->       

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- 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"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
     <Host name="localhost" appBase="webapps"   这里是 虚拟目录支持  绝对路径和相对路径
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- 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 -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

<Context path="/test" docBase="e:/hello">

      </Host>   

</Engine>
  </Service>
</Server>

3、使用Catalina  xml

时间: 2024-12-29 17:50:49

tomcate端口设定和服务器虚拟目录设定的相关文章

A网站引用B服务器虚拟目录文件导致:网站部署到IIS7上出现HTTP 错误 500.19(由于权限不足而无法读取配置文件)的问题

A网站引用B服务器共享目录(虚拟目录)导致:网站部署到IIS7上出现HTTP 错误 500.19(由于权限不足而无法读取配置文件)的问题 本攻略并不是本机的部署导致的HTTP 错误 500.19 问题  本机500.19错误 解决办法连接 HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面,因为该页的相关配置数据无效. 详细错误信息模块 IIS Web Core 通知 BeginRequest 处理程序 尚未确定 错误代码 0x80070005 配置

Linux服务器上apache虚拟目录和多端口多主机名配置

实验 实验环境: 在虚拟机上搭建一台linux服务器和一台win7客户机:   实验要求:   一,创建Apache服务并配置虚拟目录实现客户机访问,设置httpd服务的访问控制. 二,创建基于域名,不同端口号的虚拟WEB主机.   实验步骤:   一,创建Apache服务并配置虚拟目录实现客户机访问,设置httpd服务的访问控制:   使用RPM方式安装Apache服务: 编辑httpd服务配置文件,设置监听的IP地址,端口号,域名. 进入/etc/httpd/conf.d目录下创建名为vdi

TOMCAT服务器不写端口号、不写项目名访问项目、虚拟目录配置

一.不写端口. 这个问题都被问烂了,因为TOMCAT默认的访问端口为8080,而TCP/IP协议默认80端口访问,大家之所以看到别的网站都不写端口号是因为人家用的的80端口访问的,而80端口因为的TCP/IP的默认端口所以就不用写出来了.大家如果想改的话可以在tomcat安装目录中的conf文件中的server.xml文件中的 <Connector connectionTimeout="20000" port="80" protocol="HTTP/

WEB服务器4--IIS中网站、Web应用程序和虚拟目录

网站.Web应用程序和虚拟目录 在IIS中可以创建网站.Web 应用程序和虚拟目录,以便与计算机网络上的用户共享信息. “网站”.“Web 应用程序”和“虚拟目录”这三个概念的关系如图 8?1所示. 一个“网站(Web Site)”包含一个或多个“ Web 应用程序(Web Application)” 一个Web 应用程序包含一个或多个“虚拟目录(Virtual Directory)” 虚拟目录则映射到 Web 服务器或远程计算机上的物理目录. 图中可以清楚地看到此Web服务器上有两个“网站”:

Apache配置与应用,虚拟目录;访问控制;虚拟Web主机(多域名;多端口),

1,虚拟目录 Httpd  虚拟目录 便于网站管理和维护,内容分类.例如: hhtpd://www.benet.com/news  新闻 Httpd://www.benet.com/edu   学习 以redhat6.5系统为例进行配置(系统默认自带httpd服务),首先修改httpd.conf配置文件 , (1)建立一个web站点www.benet.com vim  /etc/httpd/conf/httpd.conf 添加站点首页文档index.html (2)并搭建一个DNS服务,解析域名

apache虚拟目录和多端口多主机名配置

实验要求:用户授权访问和搭建基于域名的虚拟主机,基于ip地址,基于端口的虚拟主机 实验步骤: 1.基于ip地址 首先挂载,然后我查看下我有没有httpd,如果没有就有rpm安装httpd 然后用vi编辑器进入httpd.conf配置文件,改下监听端口(是你linuX自己的ip地址), 在改一个完全合格域名 启动服务,并且关闭防火墙 在宿主机上打开网页输入ip地址192.168.10.10,打开了apache默认网页 你可以echo一个,把默认网页改成this is apache toot 在回到

Apache虚拟目录、用户认证、基于端口/IP/域名的虚拟主机、SSL

环境配置: 配置DNS以便域名解析 安装Bind软件包. yum install -y bind 2. 修改Bind配置文件. vim /etc/named.conf listen-on port 53 { 192.168.200.101; }; allow-query { any; }; vim /etc/named.rfc1912.zones zone "a.com" IN { type master; file "a.com.localhost"; allow

Apache搭建Web主机(虚拟目录、分别基于IP地址、端口、主机名)

Apache介绍 Apache HTTP Server是一款开源的网站服务软件,在Web服务器领域中长期保持着超过半数的份额,Apache服务器可以运行在Linux.UNIX.Windows等多数操作系统平台中. Apache服务器在功能.性能和安全性等方面的表现都是比较突出的,可以较好地满足Web服务器用户的应用需求,其主要特点包括以下几个方面: 开放源代码 跨平台应用 支持各种Web编程语言 模块化设计 运行非常稳定 良好的安全性 构建虚拟Web主机 在同一台Apache服务器中运行多个We

Linux Redhat 6.5 apache虚拟目录和多端口多主机名配置

Apache是世界使用排名第一的Web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一.它快速.可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中. **实验目标为 实现虚拟目录 实现用户登陆显示不同页面 实现域名访问 实验准备环境Redhat 6.5版本 安装对应的RPM包 挂载光盘 [[email protected] ~]# rpm -ivh /mnt/Packages/httpd-2.2.