I try to deploy my app from Docker.
In Dockerfile:
FROM tomcat:9-jre8-alpine
ADD config/tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
ADD config/settings.xml /usr/local/tomcat/conf/settings.xml
ADD config/context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml
ADD target/author.war /usr/local/tomcat/webapps/ROOT.war
EXPOSE 8080
CMD ["catalina.sh","run"]
so, in tomcat-users.xml:
<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
http://tomcat.apache.org/xml "
version="1.0">
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
in settings.xml:
<servers>
<server>
<id>TomcatServer</id>
<username>tomcat</username>
<password>s3cret</password>
</server>
</servers>
and in context.xml:
<Context antiResourceLocking="false" privileged="true" >
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow=".*" />
</Context>
But, trying to access Tomcat manager app remotely (domain in plesk), I have got:
“You are not authorized to view this page.By default the Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you’ll need to edit the Manager’s context.xml file….”
Additionally: for localhost-connection its work well! The problem in remote-connection
3
Answers
this worked for me:
1-get the image:
2-create folder
d:folder123
3-copy
conftomcat-users.xml
andwebappsmanagerMETA-INFcontext.xml
tod:folder123
4-add below to
tomcat-users.xml
5-remove below from
context.xml
6-create
Dockerfile
ind:folder123
with this content7-create new image named
amirimage1
8-run image
have you checked the valve value in manager.xml? there was another valve stanza with the IP restriction and I have disabled it. all worked then
/conf/Catalina/localhost/
It may be a bit late but I had the same problem. I solved it by editing the password of the user "robot" which says "must-be-changed" and not only the password of the "admin" user:
I’m using tomcat 10 with docker. I was using only the user "admin" and it’s a little weird that you need to change the password of the other user but in the other hand they say "must-be-changed".