1

I have the exact same question with this guy: Tomcat 7 Manager - how to authenticate?

I'm using Windows and I downloaded the Tomcat 7.0.39 Installer for Windows. When the installer was running, I didn't set any username and password for it (which means I left these textfield blank). However, when I tried to look up the Server Status on the Tomcat server hompage, it reminded me to enter the username and password. Whatever I enter, included not entering anything, it wouldn't let me pass.

Then, I googled and modified the usernames and passwords as what I was told:

<?xml version='1.0' encoding='cp936'?>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="admin-gui"/>
  <role rolename="admin-script"/>
  <user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/>
</tomcat-users>

Then, I restarted Tomcat. But I still cannot pass. I have searched very carefully but really cannot find an answer through Internet.

4

1 回答 1

1

我已经很久没有问这个问题了。可悲的是,我没有得到任何答案。但是,我最近碰巧找到了解决方案。

事实证明,这是 Tomcat 7.X 的安装程序的错。Tomcat 7.X 的windows 安装程序,我在网上某处看到的,本身就有一些问题/错误,换句话说,它不如解压后可以直接使用的zip 文件那么完美。我尝试了zip文件,这次修改了%TOMCAT FOLDER%/conf/tomcat-users.xml文件。然后我得到了正确的结果。

所以,对于还在使用 Windows 的小伙伴,我建议不要使用 Tomcat 7.X 安装程序,而是直接使用压缩包文件

于 2013-05-07T06:22:07.523 回答