JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Application Server » Tomcat  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 新建用户失败:(
jiangshachina

Hi, Java!



發文: 565
積分: 1
於 2006-03-31 13:20 user profilesend a private message to usersend email to jiangshachinareply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
使用Tomcat 5.5.16(apache-tomcat-5.5.16.zip),在tomcat-users.xml中加入两行语句,改变后的该文件内容如下:
1
2
3
4
5
6
7
8
9
10
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="admin" password="admin" roles="admin"/>
</tomcat-users>

使用admin/admin进入Tomcat Manager,确报错误:
Access to the specified resource (Access to the requested resource has been denied) has been forbidden.
请问,何解?


reply to postreply to post
a cup of Java, cheers!
同是Java爱好者,相逢何必曾相识!
作者 Re:新建用户失败:( [Re:jiangshachina]
jiangshachina

Hi, Java!



發文: 565
積分: 1
於 2006-03-31 13:36 user profilesend a private message to usersend email to jiangshachinareply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
问题已经解决了。
在其中再添加一个角色manager就可以了,更改后的tomcat-users.xml全文如下:
1
2
3
4
5
6
7
8
9
10
11
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>


reply to postreply to post
a cup of Java, cheers!
同是Java爱好者,相逢何必曾相识!
作者 Re:新建用户失败:( [Re:jiangshachina]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2006-03-31 14:45 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
感謝分享Smile

koji


reply to postreply to post
JCConf Taiwan 2015 開始售票了!!
Facebook上的TWJUG社團,歡迎加入
作者 Re:新建用户失败:( [Re:jiangshachina]
jiangshachina

Hi, Java!



發文: 565
積分: 1
於 2006-03-31 16:20 user profilesend a private message to usersend email to jiangshachinareply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
其实是用了一个“笨”办法。
我使用用于windows下的安装程序另外安装一个tomcat,这样它会在安装时询问用户使用什么用户名和密码。安装完毕后,我再查看tomcat-users.xml,就知道应该如何正确地修改该文件了。
Tongue


reply to postreply to post
a cup of Java, cheers!
同是Java爱好者,相逢何必曾相识!
» JWorld@TW »  Application Server » Tomcat

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8