Tomcat去掉8080端口的方法

1.修改Tomcat/webapps/ROOT/WEB-INF下的web.xml文件如下:

<? xml version="1.0" encoding="ISO-8859-1" ?>

<! DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"
>

< web-app >
    
< welcome-file-list >
        
< welcome-file > index.html </ welcome-file >
        
< welcome-file > index.htm </ welcome-file >
        
< welcome-file > index.jsp </ welcome-file >
    
</ welcome-file-list >
</ web-app >

2.在Tomcat/webapps/ROOT建立index.html文件,写入如下代码:

< head >< meta  http-equiv ="REFRESH"  content ="1; url=../工程文件夹" ></ head >

3.修改Tomcat/conf下的server.xml文件,把8080端口改成80:

     <!--  Define a non-SSL HTTP/1.1 Connector on port 8080  -->
    
< Connector  port ="80"  maxHttpHeaderSize ="8192"
               maxThreads
="150"  minSpareThreads ="25"  maxSpareThreads ="75"
               enableLookups
="false"  redirectPort ="8443"  acceptCount ="100"
               connectionTimeout
="20000"  disableUploadTimeout ="true"   />

此时在浏览器键入本地IP即可访问工程网站!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值