Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot edit tomcat-users.xml

Tags:

tomcat

tomcat7

According to the instructions in some blogs I tried to modify the C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\tomcat-users.xml file as

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

But Save Failed dialog box is appearing with the text " Please check if this file is opened in another program". But I am sure that none of the programs are started/running related to this file. The modification permission is denied. what is the reason..?

like image 470
Sajeev Avatar asked Jan 05 '13 15:01

Sajeev


People also ask

Where is Tomcat user xml?

Open the tomcat-users. xml file, which is located by default in $CATALINA_HOME\conf\tomcat-users. xml.

Which file is used to configure users in Tomcat?

XML. The server. xml file is Tomcat's main configuration file, and is responsible for specifying Tomcat's initial configuration on startup as well as defining the way and order in which Tomcat boots and builds.

How do I change my Tomcat username and password in Netbeans?

Solution. To change the Apache Tomcat Administration Console password, perform the following: Edit the [CCMS Web Path]/apache-tomcat-[version]/conf/tomcat-users. xml file and update the password.


1 Answers

I think the reason is that you can't edit files in "Program Files" without administrator rights.

I had that kind of problem several times and I usually solve it by running my text editor with admin rights.

For example, to edit file with notepad in Windows 7: Find it in your start menu, click on it with right mouse button. You should be able to choose "run as administrator" from the context menu. Now edit the file and you should be able to save it.

like image 169
Paweł Chorążyk Avatar answered Sep 16 '22 15:09

Paweł Chorążyk