You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Philip Rego <re...@gmail.com> on 2018/04/05 04:37:06 UTC

Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

http://24.0.5.14:8081/manager/html


*tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml
tomcat-users.xsd"
              version="1.0">
  <role rolename="manager-gui"/>
  <user username="tomcat" password="s3cret" roles="manager-gui"/>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager-gui"/>
  <user username="hello" password="p4ssw0rd" roles="manager-gui"/>
  <user username="tomcat" password="p4ssw0rd"
roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
  <role rolename="manager"/>
  <user username="admin" password="admin" roles="manager"/>
</tomcat-users>

(I followed this <https://stackoverflow.com/a/36773669/1308453> so I
believe anyone could have access.)

Why can't I log in? I get a 401 error when I try with any these users. Do I
have them set correctly? The 401 error said I can get access by adding the
user "tomcat" like I so. I also read the documentation
<http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_Application_Access>
but
I must not understand. I tried running tomcat on my windows computer and
got a similar 403 error. I originally had this issue when I was trying to
integrate my Spring Boot app in Jenkins and got error

org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
The username and password you provided are not correct (error 401).

(I know it's not safe giving out passwords like this but there's
nothing on the machine I care about, and want to have the issue
resolved)

Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Philip Rego <re...@gmail.com>.
Ah sorry I dont know why I didn't look at the logs. Thank you for helping

On Thu, Apr 5, 2018, 3:55 PM Mark Thomas <ma...@apache.org> wrote:

> On 05/04/18 20:46, Mark Thomas wrote:
>
> <snip/>
>
> > Looking.
> >
> > You need to remove conf/Catalina/localhost/context.xml
> > It would help if everything under work was world writeable as well.
>
> It is fixed but I can't start tomcat properly as the temp user due to
> file permissions.
>
> Tomcat is currently stopped. You may need to do the following
>
> cd /opt/tomcat
> rm -rf work/*
> rm -rf conf/Catalina/localhost/*
>
> I'm guessing you didn't look at the logs. All the information you needed
> was there. The very first exception was:
>
> org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at
> line 1 column 36: Element type "xml" must be followed by either
> attribute specifications, ">" or "/>".
>
>
> You had this at the start of tomcat-users.xml:
> <xml version="1.0" encoding="UTF-8"?>
>
> You should have had this:
> <?xml version="1.0" encoding="UTF-8"?>
>
> (look at the second character)
>
> Mark
>
>
>
> >
> > Mark
> >
> >
> >>
> >> On Thu, Apr 5, 2018 at 10:54 AM, Christopher Schultz
> >> <chris@christopherschultz.net <ma...@christopherschultz.net>>
> wrote:
> >>
> >> Philip,
> >>
> >> On 4/5/18 12:37 AM, Philip Rego wrote:
> >>> http://24.0.5.14:8081/manager/html
> >> <http://24.0.5.14:8081/manager/html>
> >>
> >> Reach? Yes. Login? No.
> >>
> >>> *tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?>
> >>> <tomcat-users xmlns="http://tomcat.apache.org/xml <
> http://tomcat.apache.org/xml>"
> >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> >> <http://www.w3.org/2001/XMLSchema-instance>"
> >>> xsi:schemaLocation="http://tomcat.apache.org/xml <
> http://tomcat.apache.org/xml>
> >> tomcat-users.xsd"
> >>> version="1.0"> <role rolename="manager-gui"/> <user
> >>> username="tomcat" password="s3cret" roles="manager-gui"/> <role
> >>> rolename="tomcat"/> <role rolename="role1"/> <role
> >>> rolename="manager-gui"/> <user username="hello" password="p4ssw0rd"
> >>> roles="manager-gui"/> <user username="tomcat" password="p4ssw0rd"
> >>> roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
> >>
> >>
> >> <role rolename="manager"/>
> >>> <user username="admin" password="admin" roles="manager"/>
> >>> </tomcat-users>
> >>
> >> I tried users "tomcat" and "hello". Your file looks okay to me.
> >>
> >>> Why can't I log in? I get a 401 error when I try with any these
> >>> users. Do I have them set correctly? The 401 error said I can get
> >>> access by adding the user "tomcat" like I so. I also read the
> >>> documentation
> >>
> >> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
> >> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App>
> >> lication_Access>
> >>
> >>
> >> but
> >>> I must not understand. I tried running tomcat on my windows
> >>> computer and got a similar 403 error. I originally had this issue
> >>> when I was trying to integrate my Spring Boot app in Jenkins and
> >>> got error
> >>
> >>> org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
> >>
> >>
> >> The username and password you provided are not correct (error 401).
> >>
> >>> (I know it's not safe giving out passwords like this but there's
> >>> nothing on the machine I care about, and want to have the issue
> >>> resolved)
> >>
> >> My guess is that one or more of the following is true:
> >>
> >> 1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory
> >>
> >> 2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
> >> for MemoryUserDatabaseFactory
> >>
> >> 3. Your Manager application doesn't have a <Realm> configured
> >>
> >> Can you confirm all of the above?
> >>
> >> -chris
> >>
> >>
>  ---------------------------------------------------------------------
> >>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>     <ma...@tomcat.apache.org>
> >>     For additional commands, e-mail: users-help@tomcat.apache.org
> >>     <ma...@tomcat.apache.org>
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>

Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Mark Thomas <ma...@apache.org>.
On 05/04/18 20:46, Mark Thomas wrote:

<snip/>

> Looking.
> 
> You need to remove conf/Catalina/localhost/context.xml
> It would help if everything under work was world writeable as well.

It is fixed but I can't start tomcat properly as the temp user due to
file permissions.

Tomcat is currently stopped. You may need to do the following

cd /opt/tomcat
rm -rf work/*
rm -rf conf/Catalina/localhost/*

I'm guessing you didn't look at the logs. All the information you needed
was there. The very first exception was:

org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at
line 1 column 36: Element type "xml" must be followed by either
attribute specifications, ">" or "/>".


You had this at the start of tomcat-users.xml:
<xml version="1.0" encoding="UTF-8"?>

You should have had this:
<?xml version="1.0" encoding="UTF-8"?>

(look at the second character)

Mark



> 
> Mark
> 
> 
>>
>> On Thu, Apr 5, 2018 at 10:54 AM, Christopher Schultz
>> <chris@christopherschultz.net <ma...@christopherschultz.net>> wrote:
>>
>> Philip,
>>
>> On 4/5/18 12:37 AM, Philip Rego wrote:
>>> http://24.0.5.14:8081/manager/html
>> <http://24.0.5.14:8081/manager/html>
>>
>> Reach? Yes. Login? No.
>>
>>> *tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?>
>>> <tomcat-users xmlns="http://tomcat.apache.org/xml <http://tomcat.apache.org/xml>"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
>> <http://www.w3.org/2001/XMLSchema-instance>"
>>> xsi:schemaLocation="http://tomcat.apache.org/xml <http://tomcat.apache.org/xml>
>> tomcat-users.xsd"
>>> version="1.0"> <role rolename="manager-gui"/> <user
>>> username="tomcat" password="s3cret" roles="manager-gui"/> <role
>>> rolename="tomcat"/> <role rolename="role1"/> <role
>>> rolename="manager-gui"/> <user username="hello" password="p4ssw0rd"
>>> roles="manager-gui"/> <user username="tomcat" password="p4ssw0rd"
>>> roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
>>
>>
>> <role rolename="manager"/>
>>> <user username="admin" password="admin" roles="manager"/>
>>> </tomcat-users>
>>
>> I tried users "tomcat" and "hello". Your file looks okay to me.
>>
>>> Why can't I log in? I get a 401 error when I try with any these
>>> users. Do I have them set correctly? The 401 error said I can get
>>> access by adding the user "tomcat" like I so. I also read the
>>> documentation
>>
>> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
>> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App>
>> lication_Access>
>>
>>
>> but
>>> I must not understand. I tried running tomcat on my windows
>>> computer and got a similar 403 error. I originally had this issue
>>> when I was trying to integrate my Spring Boot app in Jenkins and
>>> got error
>>
>>> org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
>>
>>
>> The username and password you provided are not correct (error 401).
>>
>>> (I know it's not safe giving out passwords like this but there's
>>> nothing on the machine I care about, and want to have the issue
>>> resolved)
>>
>> My guess is that one or more of the following is true:
>>
>> 1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory
>>
>> 2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
>> for MemoryUserDatabaseFactory
>>
>> 3. Your Manager application doesn't have a <Realm> configured
>>
>> Can you confirm all of the above?
>>
>> -chris
>>
>>     ---------------------------------------------------------------------
>>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>     For additional commands, e-mail: users-help@tomcat.apache.org
>>     <ma...@tomcat.apache.org>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Mark Thomas <ma...@apache.org>.
On 05/04/18 19:55, Philip Rego wrote:
> @chris@christopherschultz.net <ma...@christopherschultz.net>
> 1. $ ls $CATALINA_BASE
> bin  conf  lib  LICENSE  logs  NOTICE  RELEASE-NOTES  RUNNING.txt  temp 
> webapps  work
> 
> When I run startup.sh it shows this:
> $ $CATALINA_BASE/bin/startup.sh
> Using CATALINA_BASE:   /opt/tomcat
> Using CATALINA_HOME:   /opt/tomcat
> Using CATALINA_TMPDIR: /opt/tomcat/temp
> Using JRE_HOME:        /usr/
> Using CLASSPATH:     
>  /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
> Tomcat started.
> 
> I have the variables set in .bashrc, but I'm not sure if there's another
> way I need to set them. 
> 
> 2. $ cat $CATALINA_BASE/conf/server.xml
> 
> <?xml version="1.0" encoding="UTF-8"?>
> ...
>   <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="tomcat-users.xml" />
>   </GlobalNamingResources>
> ...
> I changed the path from "conf/tomcat-users.xml"  to just
> "tomcat-users.xml" because it's already in the conf folder but it didn't
> seem to make a difference. 
> 
> 3.  <Engine name="Catalina" defaultHost="localhost">
> ...
>       <Realm className="org.apache.catalina.realm.LockOutRealm">
>         <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>                resourceName="UserDatabase"/>
>       </Realm>
> ...
>     </Engine>
> Don't know to much about Realms but it seems to be ok with the default
> values. 
> 
> 4. I've been restarting my server and running shutdown.sh startup.sh often. 
> 
> Thank you for the responses but I still can't figure out what's wrong.
> Let me know if you have any more suggestions. If you want to look for
> yourself you can log in with
> ssh temp@24.0.5.14 <ma...@24.0.5.14>
> s3cret
> cd /opt/tomcat

Looking.

You need to remove conf/Catalina/localhost/context.xml
It would help if everything under work was world writeable as well.

Mark


> 
> On Thu, Apr 5, 2018 at 10:54 AM, Christopher Schultz
> <chris@christopherschultz.net <ma...@christopherschultz.net>> wrote:
> 
> Philip,
> 
> On 4/5/18 12:37 AM, Philip Rego wrote:
>> http://24.0.5.14:8081/manager/html
> <http://24.0.5.14:8081/manager/html>
> 
> Reach? Yes. Login? No.
> 
>> *tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?>
>> <tomcat-users xmlns="http://tomcat.apache.org/xml <http://tomcat.apache.org/xml>"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance>"
>> xsi:schemaLocation="http://tomcat.apache.org/xml <http://tomcat.apache.org/xml>
> tomcat-users.xsd"
>> version="1.0"> <role rolename="manager-gui"/> <user
>> username="tomcat" password="s3cret" roles="manager-gui"/> <role
>> rolename="tomcat"/> <role rolename="role1"/> <role
>> rolename="manager-gui"/> <user username="hello" password="p4ssw0rd"
>> roles="manager-gui"/> <user username="tomcat" password="p4ssw0rd"
>> roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
> 
> 
> <role rolename="manager"/>
>> <user username="admin" password="admin" roles="manager"/>
>> </tomcat-users>
> 
> I tried users "tomcat" and "hello". Your file looks okay to me.
> 
>> Why can't I log in? I get a 401 error when I try with any these
>> users. Do I have them set correctly? The 401 error said I can get
>> access by adding the user "tomcat" like I so. I also read the
>> documentation
> 
> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App>
> lication_Access>
> 
> 
> but
>> I must not understand. I tried running tomcat on my windows
>> computer and got a similar 403 error. I originally had this issue
>> when I was trying to integrate my Spring Boot app in Jenkins and
>> got error
> 
>> org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
> 
> 
> The username and password you provided are not correct (error 401).
> 
>> (I know it's not safe giving out passwords like this but there's
>> nothing on the machine I care about, and want to have the issue
>> resolved)
> 
> My guess is that one or more of the following is true:
> 
> 1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory
> 
> 2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
> for MemoryUserDatabaseFactory
> 
> 3. Your Manager application doesn't have a <Realm> configured
> 
> Can you confirm all of the above?
> 
> -chris
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>     <ma...@tomcat.apache.org>
>     For additional commands, e-mail: users-help@tomcat.apache.org
>     <ma...@tomcat.apache.org>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Philip Rego <re...@gmail.com>.
 @chris@christopherschultz.net
1. $ ls $CATALINA_BASE
bin  conf  lib  LICENSE  logs  NOTICE  RELEASE-NOTES  RUNNING.txt  temp
webapps  work

When I run startup.sh it shows this:
$ $CATALINA_BASE/bin/startup.sh
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/
Using CLASSPATH:
 /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Tomcat started.

I have the variables set in .bashrc, but I'm not sure if there's another
way I need to set them.

2. $ cat $CATALINA_BASE/conf/server.xml

<?xml version="1.0" encoding="UTF-8"?>
...
  <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="tomcat-users.xml" />
  </GlobalNamingResources>
...
I changed the path from "conf/tomcat-users.xml"  to just "tomcat-users.xml"
because it's already in the conf folder but it didn't seem to make a
difference.

3.  <Engine name="Catalina" defaultHost="localhost">
...
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
...
    </Engine>
Don't know to much about Realms but it seems to be ok with the default
values.

4. I've been restarting my server and running shutdown.sh startup.sh often.

Thank you for the responses but I still can't figure out what's wrong. Let
me know if you have any more suggestions. If you want to look for yourself
you can log in with
ssh temp@24.0.5.14
s3cret
cd /opt/tomcat

On Thu, Apr 5, 2018 at 10:54 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Philip,
>
> On 4/5/18 12:37 AM, Philip Rego wrote:
> > http://24.0.5.14:8081/manager/html
>
> Reach? Yes. Login? No.
>
> > *tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?>
> > <tomcat-users xmlns="http://tomcat.apache.org/xml"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
> > version="1.0"> <role rolename="manager-gui"/> <user
> > username="tomcat" password="s3cret" roles="manager-gui"/> <role
> > rolename="tomcat"/> <role rolename="role1"/> <role
> > rolename="manager-gui"/> <user username="hello" password="p4ssw0rd"
> > roles="manager-gui"/> <user username="tomcat" password="p4ssw0rd"
> > roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
> >
> >
> <role rolename="manager"/>
> > <user username="admin" password="admin" roles="manager"/>
> > </tomcat-users>
>
> I tried users "tomcat" and "hello". Your file looks okay to me.
>
> > Why can't I log in? I get a 401 error when I try with any these
> > users. Do I have them set correctly? The 401 error said I can get
> > access by adding the user "tomcat" like I so. I also read the
> > documentation
> > <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
> lication_Access>
> >
> >
> but
> > I must not understand. I tried running tomcat on my windows
> > computer and got a similar 403 error. I originally had this issue
> > when I was trying to integrate my Spring Boot app in Jenkins and
> > got error
> >
> > org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
> >
> >
> The username and password you provided are not correct (error 401).
> >
> > (I know it's not safe giving out passwords like this but there's
> > nothing on the machine I care about, and want to have the issue
> > resolved)
>
> My guess is that one or more of the following is true:
>
> 1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory
>
> 2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
> for MemoryUserDatabaseFactory
>
> 3. Your Manager application doesn't have a <Realm> configured
>
> Can you confirm all of the above?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGOKYACgkQHPApP6U8
> pFh/RBAAq7PwPcwQ9HjBLne2qf5K1WJBO7gVSBUsJ9nVlkcgwnnlJhN4bI9tW69G
> vuovsDZKuWPYNrh/1IqNjJ9DUxrO7bitO07AOJRpQcKsdtYeLx6k6xMdBj4bi/Vr
> ysHm41pv6rT0YxAN3oBUaDWbG32CNIhKz6LOos1iKJ7/k4OH5KJsUy4pXDce2Rop
> ybP7iuB8bmrx7TYHlKrtoNCUAQs0ah+0xlQ7kmrzgVKHhotKjukCmMLifaYZ823A
> 7HI4x/XF3xx202dSuUx7OMwBNlDcU8SOEt/cXsU1bRVUfeRK/tm1RVogoe2+hDZW
> eIIpdnPnpsJaMp5FpBaS+VybHwjKfZyfY4rCl2q1lF3bRPDP6b9Xzu67+C6z0pnU
> 6LD4IKxIVMrPSwk3aTLcfrSvmUPla2nWV1Mp/KOl1QacQsBHW5LWA/Z+EAV6BaOU
> foG+V7ICdEWri4G1x6uAlFgbfgQe+1nIfUpJ+8dpI0uW9wY56nMzKHF3Hj65KkBq
> yOT00WxPLwhlNGre5dDLeoeN8i6ft9lxKvt+W1b58H9whySmhL2xULPIW9oPk1I2
> Ua3Z17JkQSJKcX2EONW/T4vwGhhRFEXMmcge3tMWlpB4jch7CXJ5zFgUHzn2UB1R
> NHLCtnxgTEJ2s6clckxuR+jMNl0+mktTcnGTUadpc6Cw0/hWvSg=
> =3lRR
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Konstantin Kolinko <kn...@gmail.com>.
>> Why can't I log in? I get a 401 error when I try with any these
>> users. Do I have them set correctly? The 401 error said I can get
>> access by adding the user "tomcat" like I so. I also read the
>> documentation
>> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
> lication_Access>
>>
>>
> but
>> I must not understand. I tried running tomcat on my windows
>> computer and got a similar 403 error. I originally had this issue
>> when I was trying to integrate my Spring Boot app in Jenkins and
>> got error
>>
>> org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
>>
>>
> The username and password you provided are not correct (error 401).
>>

1. Do not confuse error 401 and error 403.

HTTP Response Status 401 means that server asks you for a different
user name / password.
-- Your name/password are wrong.

HTTP Response Status 401 means that access have been denied:
a) Your name/password are known, but the user does not have rights to
access the page. => Check roles of an user.

b) Your name/password are known, but CSRF token has expired. => Go to
<site>/manager/html. The entrance page does not need a CSRF token.

c) You have been blocked by your IP address (by RemoteAddrValve).
(No user name is asked)


>
> My guess is that one or more of the following is true:
>
> 1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory
>
> 2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
> for MemoryUserDatabaseFactory
>
> 3. Your Manager application doesn't have a <Realm> configured
>
> Can you confirm all of the above?

4. You did not restart your Tomcat after editing the file.

The tomcat-users.xml file is read when Tomcat starts. You need to
restart Tomcat for the changes to take effect.



Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can you access my Manager App? http://24.0.5.14:8081/manager/html Tomcat/8.5.29, CentOS&Win10

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Philip,

On 4/5/18 12:37 AM, Philip Rego wrote:
> http://24.0.5.14:8081/manager/html

Reach? Yes. Login? No.

> *tomcat-users.xml*<xml version="1.0" encoding="UTF-8"?> 
> <tomcat-users xmlns="http://tomcat.apache.org/xml" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" 
> version="1.0"> <role rolename="manager-gui"/> <user
> username="tomcat" password="s3cret" roles="manager-gui"/> <role
> rolename="tomcat"/> <role rolename="role1"/> <role
> rolename="manager-gui"/> <user username="hello" password="p4ssw0rd"
> roles="manager-gui"/> <user username="tomcat" password="p4ssw0rd" 
> roles="standard,manager-gui,tomcat,manager-script,manager-script"/>
>
> 
<role rolename="manager"/>
> <user username="admin" password="admin" roles="manager"/> 
> </tomcat-users>

I tried users "tomcat" and "hello". Your file looks okay to me.

> Why can't I log in? I get a 401 error when I try with any these
> users. Do I have them set correctly? The 401 error said I can get
> access by adding the user "tomcat" like I so. I also read the
> documentation 
> <http://24.0.5.14:8081/docs/manager-howto.html#Configuring_Manager_App
lication_Access>
>
> 
but
> I must not understand. I tried running tomcat on my windows
> computer and got a similar 403 error. I originally had this issue
> when I was trying to integrate my Spring Boot app in Jenkins and
> got error
> 
> org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
>
> 
The username and password you provided are not correct (error 401).
> 
> (I know it's not safe giving out passwords like this but there's 
> nothing on the machine I care about, and want to have the issue 
> resolved)

My guess is that one or more of the following is true:

1. The tomcat-users.xml file isn't in your CATALINA_BASE/conf/ directory

2. Your CATALINA_BASE/conf/server.xml does not have a <Resource> in it
for MemoryUserDatabaseFactory

3. Your Manager application doesn't have a <Realm> configured

Can you confirm all of the above?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrGOKYACgkQHPApP6U8
pFh/RBAAq7PwPcwQ9HjBLne2qf5K1WJBO7gVSBUsJ9nVlkcgwnnlJhN4bI9tW69G
vuovsDZKuWPYNrh/1IqNjJ9DUxrO7bitO07AOJRpQcKsdtYeLx6k6xMdBj4bi/Vr
ysHm41pv6rT0YxAN3oBUaDWbG32CNIhKz6LOos1iKJ7/k4OH5KJsUy4pXDce2Rop
ybP7iuB8bmrx7TYHlKrtoNCUAQs0ah+0xlQ7kmrzgVKHhotKjukCmMLifaYZ823A
7HI4x/XF3xx202dSuUx7OMwBNlDcU8SOEt/cXsU1bRVUfeRK/tm1RVogoe2+hDZW
eIIpdnPnpsJaMp5FpBaS+VybHwjKfZyfY4rCl2q1lF3bRPDP6b9Xzu67+C6z0pnU
6LD4IKxIVMrPSwk3aTLcfrSvmUPla2nWV1Mp/KOl1QacQsBHW5LWA/Z+EAV6BaOU
foG+V7ICdEWri4G1x6uAlFgbfgQe+1nIfUpJ+8dpI0uW9wY56nMzKHF3Hj65KkBq
yOT00WxPLwhlNGre5dDLeoeN8i6ft9lxKvt+W1b58H9whySmhL2xULPIW9oPk1I2
Ua3Z17JkQSJKcX2EONW/T4vwGhhRFEXMmcge3tMWlpB4jch7CXJ5zFgUHzn2UB1R
NHLCtnxgTEJ2s6clckxuR+jMNl0+mktTcnGTUadpc6Cw0/hWvSg=
=3lRR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org