Saturday, April 5, 2008

Create a manager accout

It is very usefull to create a manager account in your tomcat. In fact it will be used to access all the administration sections that you can see if you point to the root of your tomcat from a browser (e.g. http://localhost:8080/). But it is also usefull if you want to start, stop, redeploy... from the url with the tomcat manager (http://{host}:{port}/manager/{command}?{parameters}) or with ant. We have to open tomcat-users.xml (..apache-tomcat-5.5.26\conf\tomcat-users.xml). We will add the following lines:

<role rolename="manager">
...
<user username="user" password="pass" roles="manager">

So in the end we will have something like this:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="user" password="pass" roles="manager"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>

No comments: