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
    一辈子很短,努力的做好两件事就好;第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。
  • 相关阅读:
    shell脚本学习(1)列出一组IP内所有活动主机
    中兴ZXR10 GER4核心路由器配置案例
    中兴ZXR10 6905核心交换机配置案例
    NFS笔记(二)NFS服务器配置实例
    NFS笔记(一)NFS服务器工作原理及详细配置
    CentOS7.3下关于DHCP中继代理服务器的详细配置
    CentOS6下DHCP服务(二)简单配置案例及故障排查
    impdp 多个表空间到1个表空间通配符的使用
    11.2.0.4 has 启动失败
    oracle 11g 添加删除haip
  • 原文地址:https://www.cnblogs.com/antao/p/12717825.html
Copyright © 2011-2022 走看看