Tomcat manager/html is not available?

2019-02-01 19:01发布

Hi I just installed Tomcat and and am trying to get it up and running however whenever I try to navigate to manager/html it gives me this error "The requested resource (/manager/html) is not available".

The homepage, /docs, /examples all work fine and my logs show nothing. How do I fix this? I'm using Tomcat 6.0.20 and JDK 1.6.0_21 on Windows 7 64bit.

8条回答
我欲成王,谁敢阻挡
2楼-- · 2019-02-01 19:06

I couldn't log in to the manager app, even though my tomcat-users.xml file was set up correctly. The problem was that tomcat was configured to get users from a database. An employee who knew how this all worked left the company so I had to track this all down.

If you have a web application with something like this in the projects web.xml:

<security-role>
    <role-name>manager</role-name>
</security-role>

You should be aware that this is using the same system for log ins as tomcat! So where ever your manager role user(s) are defined, that is where you should define your manager-gui role and user. In server.xml I found this:

 <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/<DBName>?user=<DBUser>&amp;password=<DBPassword>"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />

That tells me there is a database storing all the users and roles. This overrides the tomcat-users.xml file. Nothing in that file works unless this Realm is commented out. The solution is to add your tomcat user to the users table and your manager-gui role to the user_roles table:

insert into users (user_name, user_pass) values ('tomcat', '<changeMe>');
insert into user_roles (user_name, role_name) values ('tomcat', 'manager-gui');

You should also have a "manager-gui" rolename in the roles table. Add that if it doesn't exist. Hope this helps someone.

查看更多
做自己的国王
3楼-- · 2019-02-01 19:07

Your website is blank because ROOT directory is missing from your ../webapps folder. Refer to tomcat documentation for the specific location on where it should be.

查看更多
乱世女痞
4楼-- · 2019-02-01 19:09

My problem/solution is very embarrassing but who knows... perhaps it happened to someone else:

My solution: Turn off proxy

For the past two hours I've been wondering why my manager would not load. (the root was cached so it loaded). I had set the browser's proxy to proxy traffic to my house. :/

查看更多
贼婆χ
5楼-- · 2019-02-01 19:10

You have to enable access first: Configuring Manager Application Access

查看更多
做个烂人
6楼-- · 2019-02-01 19:12

Once try by replacing localhost to your 'computer name' i.e, http://localhost:8080 to http://system09:8080

查看更多
放我归山
7楼-- · 2019-02-01 19:21

In my case, the folder was _Manager. After I renamed it to Manager it worked.

Now, I see login popup and I enter credentials from conf/tomcat-users.xml, It all works fine.

查看更多
登录 后发表回答