zoukankan      html  css  js  c++  java
  • Tomcat使用经验

    1.启动和关闭

    bin目录下

    startup.bat    ##window下启动服务
    shutdown.bat    ##window下关闭服务
    
    startup.sh    ##Linux下启动服务
    shutdown.sh    ##Linux下关闭服务

    2.修改默认访问端口

    conf目录下server.xml里面;默认8080端口;默认访问页面网址127.0.0.1:8080或者localhost:8080

    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    改为8088端口;更改后访问页面网址127.0.0.1:8088或者localhost:8088

    <Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    3.修改默认访问页面

    页面默认路径,webapps目录下ROOT  中(例如我的:E:Apacheapache-tomcat-8.5.54webappsROOT)

    conf目录下web.xml里面最底部;

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

    添加myweb.html;修改为

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

    webapps目录下ROOT中增加myweb.html;

    启动服务,浏览器访问

    http://localhost:8088

    启动访问myweb.html就变成默认页面了。

    4.修改默认访问路径

    页面默认访问路径,webapps目录下ROOT  中(例如我的:E:Apacheapache-tomcat-8.5.54webappsROOT)

    conf目录下server.xml里面;找到<Host

    <Host name="localhost"  appBase="webapps"
                unpackWARs="true" autoDeploy="true">

    后面添加

    <Context path="/" docBase="e:\Apache\web" debug="0" reloadable="false" />

    把myweb.html网页放到E:Apacheweb目录下

    webapps目录下ROOT下文件和文件夹全部删除掉

    启动服务,浏览器访问

    http://localhost:8088
    一辈子很短,努力的做好两件事就好;第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。
  • 相关阅读:
    新的工作开始
    昨日的世界
    【Drools-开源业务规则引擎】入门实例(含源码)
    【cs229-Lecture7】支持向量机(SVM)
    【2014年12月6日】HR交流会
    【cs229-Lecture5】生成学习算法:1)高斯判别分析(GDA);2)朴素贝叶斯(NB)
    【图算法】Dijkstra算法及变形
    【图算法】综述
    【云迁移论文笔记】A Comparison of On-premise to Cloud Migration Approaches
    【云迁移论文笔记】Cloud Migration Research:A Systematic Review
  • 原文地址:https://www.cnblogs.com/antao/p/12717825.html
Copyright © 2011-2022 走看看