Tomcat-window2008R2下配置域名

本文详细介绍了如何在Tomcat服务器上配置端口,包括Server、Connector等元素的具体修改方法,并提供了实例演示。

找到tomcat中安装目录下的conf文件夹下的server.xml文件直接修改,这里要说明的是如果一个服务器上有多个tomcat的话,修改端口需要注意的是要修改

三个地方的

第一处是 <Server port="8085" shutdown="SHUTDOWN">

第二处是  <Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443"/>

第三处是 <Connector port="8099" protocol="AJP/1.3" redirectPort="8443"/>

    <Engine name="Catalina" defaultHost="test.fxmsoft.com">

      <!--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 name="test.fxmsoft.com"  appBase="C:/web" unpackWARs="true" autoDeploy="true">
        <Context path="test.fxmsoft.com" docBase="/member" debug="0" reloadable="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"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>

访问地址test.fxmsoft.com/member/index.html

保存server.xnl文件,重新启动服务,如果你的域名和ip绑定好的话就可以直接用域名访问了  


转载于:https://www.cnblogs.com/pll2017/p/6733010.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值