ojas
ojas

Reputation: 247

Unable to deploy war file using Tomcat Manager

I am unable to deploy war file using Tomcat Manager
My \Tomcat\conf\tomcat-users.xml looks like below:

<!--
<role rolename="manager-gui"/>    
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->

Also, edited \Servers\Tomcat v7.0 Server at localhost-config\tomcat-users.xml to

<!--
<role rolename="manager-gui"/>    
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->

Still it is showing below error on launching server as http://localhost:8080/manager/html and providing appropriate credentials

401 Unauthorized

You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.

I have also tried adding manager.xml to \Tomcat\conf but nothing worked

<Context privileged="true" antiResourceLocking="false"
         docBase="${catalina.home}/webapps/manager">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.0\.0\.1" />
</Context>

Note: I am restarting the server and http://localhost:8080/ is not working

Upvotes: 2

Views: 8339

Answers (2)

Andreas
Andreas

Reputation: 159096

The <role> and <user> tags are just plain text in an XML comment, surrounded by <!-- and -->. Remove the beginning and end of comment.

<!--    <<< BEGINNING OF COMMENT. Remove this line
<role rolename="manager-gui"/>    
<user name="tomcat" password="admin" roles="admin-gui,standard,manager-gui"/>
-->     <<< END OF COMMENT.       Remove this line

Upvotes: 2

kosa
kosa

Reputation: 66637

You need un-comment user entry in tomcat-users.xml.

You need add users to /tomcat-users.xml otherwise you can't deploy war file through manager app.

Example:

<user username="craigmcc" password="secret" roles="standard,manager-script" />

More configuration details are here.

Upvotes: 1

Related Questions