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
    一辈子很短,努力的做好两件事就好;第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。
  • 相关阅读:
    需要学习的技术
    Building wheel for uwsgi (setup.py) ... error 解决问题
    version `ZLIB_1.2.3.4‘ not found 解决方法
    module 'tensorflow' has no attribute 'space_to_depth'(已解决)
    python语法—命名元祖、偏函数
    python—set集合比较(交集、并集,差集)
    websocket接口测试
    linux根目录扩容方法
    django—问题—中文编码格式报错 、分页warning
    python—使用sorted对字典进行排序
  • 原文地址:https://www.cnblogs.com/antao/p/12717825.html
Copyright © 2011-2022 走看看