zoukankan      html  css  js  c++  java
  • 给新手--安装tomcat后username和password设置以及项目怎么部署在tomcatserver上

    安装后tomcatserver后。登陆首先就是让输入username和password。但是我们在安装tomcat的过程中好像没有让设置username和password,这时候可能有人就抓狂了。还有的人是突然忘记了username和password,对于出现这样的情况该怎么去解决呢?

    不慌。tomcat安装的过程中是没有让用户设置username和password,由于这个工作是须要用户自己在配置文件里自己书写的。步骤例如以下:

    以我安装tomcat的文件夹为例  D:Program Filesapache-tomcat-6.0.35

    进入该文件夹找到conf文件下,找到tomcat-users.xml文件,用记事本打开它



    然后在<tomcat-users></tomcat-users>中间加入<user username="" password="" roles="manager"/>

    <tomcat-users>
    <!--
      NOTE:  By default, no user is included in the "manager-gui" role required
      to operate the "/manager/html" web application.  If you wish to use this app,
      you must define such a user - the username and password are arbitrary.
    -->
    <!--
      NOTE:  The sample user and role entries below are wrapped in a comment
      and thus are ignored when reading this file. Do not forget to remove
      <!.. ..> that surrounds them.
    -->
    <!--
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <user username="tomcat" password="tomcat" roles="tomcat"/>
      <user username="both" password="tomcat" roles="tomcat,role1"/>
      <user username="role1" password="tomcat" roles="role1"/>
    -->
    <user username="" password="" roles="manager"/> 
    </tomcat-users>
    

    上述代码中引號能够自己设置username和password,假设依照我上面所写的代表是没实username和password

    这下子大家都清楚了么?

    安装好了tomcat,以下就是怎么将自己的项目部署到tomcat上了

    首先在MyEclipse中将tomcat设置好  设置的方法和地方例如以下图所看到的


    分别设置JDK  载入方式 Paths不用设置


    设置好后,将自己的项目部署到tomcat服务器上,能够利用IDE MyEclipse来部署。或者直接手动在server.xml中自己主动部署

    打开刚才的tomcat安装的conf目录 找到server.xml  打开在当中加下例如以下代码就可以

    <Context path="/struts2" docBase="D:MyEclipse 10 WorkSpacestruts2WebRoot" reloadable="true" />

    当中 struts2是项目名称  docBase是该项目的路径  reloadable表示当改动配置文件等server自己主动又一次载入


    这样,启动server就可以。

  • 相关阅读:
    基本數據類型
    5月28号 垃圾回收机制
    5月28 基本运算符
    5月30日 循环之while循环
    5月28号 与用户交互
    5月31日 基本数据类型(列表类型 字典类型 元组)及其内置方法
    5月30号 基本数据类型(整数型 字符串类型)及其内置方法
    變量
    5月29日 学习笔记 可变不可变类型 成员运算符和身份运算符 条件 流程控制之if判断
    关于Flash CS4字体不能加粗的问题[附解决方法]
  • 原文地址:https://www.cnblogs.com/zsychanpin/p/7040127.html
Copyright © 2011-2022 走看看