Tomcat 7 tomcat-users manager - script example for / deployment

I am trying to get the manager / deploy to work on my new Tomcat 7.0.34 installation, but I keep getting 403 when I try to deploy by doing PUT on http://localhost:8080/manager/deploy . I have not got this job in Tomcat 7 yet.

CONF / server.xml

 <?xml version='1.0' encoding='utf-8'?> <Server> ... <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service> ... <Engine> ... <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Engine> </Service> </Server> 

Conf / cat-users.xml

 <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <user username="tomcat" password="redacted" roles="manager-script"/> </tomcat-users> 

I also tried (with the same result)

Conf / cat-users.xml

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

And yes, I have a double, triple, fourfold check that I am using the correct username and password as defined in tomcat-users.xml. I thought that was all I needed. Any ideas?

+7
source share
1 answer

So, I finally figured it out!

Firstly, all the above settings are correct (any version of tomcat users above is correct, but I think the first one is more correct.

It might not have been explicit, initially, but I switched from Tomcat 6. What I was missing was the URL to which I was PUTting. It should have been: http://localhost:8080/manager/**text**/deploy

Now everything is working fine. Hope this helps someone in the future :)

+7
source

All Articles