各位高手,本人今天到官方下载了一个最新的Tomcat6.0.20服务器(.zip)解压后,开户服务输入:http://localhost:8080
可以正常访问,但是点击"tomcat manager"时,弹出一个一登录框,要求输入用户名和密码。
见图:本人已在conf\tomcat-users.xml文件中,添加了用户,如下:  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager"/> 但是重启tomcat服务后,还是登录不成功!貌似是用户与密码不对,输入几次后,出现一个网页:大致内容如下:401 UnauthorizedYou are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file will contain the credentials to let you use this webapp. You will need to add manager role to the config file listed above. For example: <role rolename="manager"/>
<user username="tomcat" password="s3cret" roles="manager"/>
For more information - please see the Manager App HOW-TO. 

解决方案 »

  1.   


    <?xml version='1.0' encoding='utf-8'?>
    <tomcat-users>
      <role rolename="manager"/>
      <user username="admin" password="123456" roles="manager"/>
    </tomcat-users>
      

  2.   


      <role rolename="manager"/> 
      <role rolename="admin"/> 
      <user username="admin" password="admin" roles="admin,manager"/> 我已添加了,但是不行啊????
      

  3.   

    你去掉一个role 看行吗?
      

  4.   

    去掉了,也还是不行!真是奇怪,对了,我点击那个解压出来tomcat\bin\tomcat6w.exe,出现“指定的服务并未以安装的服务存在。Unable to open the service 'tomcat2'”这样的警告,不是为何?还请你指导!谢谢了~
      

  5.   

    <user name="loki" password="000000" roles="admin,manager" />
      

  6.   

    我觉得你是没有把user配置文件中相应行前面的注释符号去掉……
    <!--XXXXXX -->