一、配置登录密码和账户
1首先找到Tomcat如右目录: /conf/tomcat-users.xml.
去掉原先的注释:
添加代码(假设我要添加管理员账号123,密码为123). <role rolename="manager"/> <role rolename="admin"/>
<user username="123" password="123" roles="admin,manager"/>
即可.总体代码如下:
<?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="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="123" password="123" roles="admin,manager"/>
</tomcat-users>
2进入项目后,如果想要继续.进入JSP文件,则应该删除web-inf下面的index.jsp文件,然后修改tomcat web.xml文件中listings的value,将其更改为true即可.
在myeclipse居然配置成功了,可以登录后台了:
用Notepad打开服务器配置文件,来修改端口,感觉寻找非常快
或者
<?xml version=‘1.0‘ encoding=‘utf-8‘?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager,admin"/>
</tomcat-users>
增加两行:
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<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="manage"/>