# How to change default user and password for Tomcat?

I have recently installed Xampp, and I am now learning JSP but after copying my .jsp file into the required file and starting Tomcat it won't let me access the manager without a user and password.

I have made no changes to any of the settings and this is a brand new install, I have managed to find the default user/password for MySQL on the net but have had no such luck for TomCat. I have used the following user/passowrd combinations till now:

• root as user and password
• xampp as user and password

Please help me with finding the default user password or better yet how to change them, I've seen some files which look like they might contain the user/passwords but I do not wish to replace things blindly.

-

Look at conf/tomcat_users.xml.

Uncomment the roles and users block. Define a role named "admin" (if tomcat6) or "manager-gui" (tomcat7). Then, define a user named as you want with the password you like AND the role admin or manager-gui.

Restart tomcat. Test

-
Thank you, this is what I needed to know. –  George Bora Dec 14 '11 at 20:13

Look at conf/tomcat_users.xml.

-
Thank you for the help, I've edited the file with Notepad ++ and decomented the roles and have tried the role1,tomcat,both and manager ones. But now while I can enter a password I get : HTTP Status 403 - Access to the requested resource has been denied . –  George Bora Dec 14 '11 at 7:36
What tocmat version are we talking about? 5.5 should have the UserDataBase activated by default in conf/server.xml and conf/Catalina/localhost/manager.xml. –  Nils Dec 14 '11 at 20:06
The version is Tomcat 7 I've managed to solve my problems with the XML file but I added this in case others have this problem your answer works for Tomcat 7. –  George Bora Dec 17 '11 at 16:23

Just look for C:\xampp\tomcat\conf\tomcat_users.xml then put your user account within <tomcat-users> tag. For example:

<tomcat-users>