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
    一辈子很短,努力的做好两件事就好;第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。
  • 相关阅读:
    注册表解锁
    Windows错误代码大全 2
    硬盘数据线的问题
    vs2010与C#4.0新特性
    (转载)C语言负数的移位运算
    (转载)看C语言编码转换负数的二进制表示方法
    (转载)C语言右移运算符的问题(特别当与取反运算符一起时)
    (转载)Qt中使用cout输出的方法
    (转载)QPainter的用法
    (转载)Qt计算MD5
  • 原文地址:https://www.cnblogs.com/antao/p/12717825.html
Copyright © 2011-2022 走看看