On 05/04/18 19:55, Philip Rego wrote:
> @ch...@christopherschultz.net <mailto:ch...@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 <mailto:temp@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
> <ch...@christopherschultz.net <mailto:ch...@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-unsubscr...@tomcat.apache.org
>     <mailto:users-unsubscr...@tomcat.apache.org>
>     For additional commands, e-mail: users-h...@tomcat.apache.org
>     <mailto:users-h...@tomcat.apache.org>
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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

Reply via email to