Tomcat 5.5端口设置

    为了与IIS的端口区别开来,Tomcat默认的端口是8080。然而很多时候,我们并不习惯于使用8080端口来访问web网站,特别是将其部署在Internet上以后,采用域名去访问它尤为不便,为此,我们希望更改Tomcat应用服务器的端口。在以前的版本中,更改端口的设置是十分方便的,只需打开Tomcat主目录中conf目录下的server.xml文件,找到其中的Connector port="8080",并将其更改为Connector port="80"即可,修改后的文件如下(有删减):

< Service  name ="Catalina" > 
 
     <!--  Define a non-SSL HTTP/1.1 Connector on port 8080, change it to 80.  --> 
     < Connector port ="80" maxHttpHeaderSize ="8192" 
               maxThreads ="150"  minSpareThreads ="25"  maxSpareThreads ="75" 
               enableLookups ="false"  redirectPort ="8443"  acceptCount ="100" 
               connectionTimeout ="20000"  disableUploadTimeout ="true"   /> 
    
     <!--  Define a SSL HTTP/1.1 Connector on port 8443  --> 
     <!-- 
    <Connector port="8443" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
     --> 
 
     <!--  Define an AJP 1.3 Connector on port 8009  --> 
     < Connector  port ="8009"  enableLookups ="false"  redirectPort ="8443"  protocol ="AJP/1.3"   /> 
 
          
     <!--  Define the top level container in our container hierarchy  --> 
     < Engine  name ="Catalina"  defaultHost ="localhost" > 
 
       <!--  Because this Realm is here, an instance will be shared globally  --> 
 
       <!--  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" > 
 
       </ Host > 
 
     </ Engine > 
 
   </ Service > 

 

改动好以后,重启Tomcat,改动就生效了,应该说,还是挺方便的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值