I have recently assumed duties over a site using Tomcat 8 and I am having a hard time getting a view of my manager app and site on the development server. I have set up PuTTy for ssh onto the server and I have configured port forwarding so that the base manager menu for Tomcat shows on localhost:8080 on my machine, indicating that the ssh/port forwarding appears to be working. I get the 403 error when I try to access any other element of the manager gui. I have reviewed multiple versions of this question from the past and I still think my issue is unique to them. (links here to those answers: 403 Access Denied on Tomcat 8 Manager App without prompting for user/password Can't access Tomcat 8 Manager App Tomcat 8.5 - 403 Access Denied)
When looking at the previous questions they reference changing a context.xml file to comment out a valve tag inside the context tag, but my context.xml file doesn't contain this valve tag:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="" reloadable="false">
<ResourceLink global="jdbc/MyDS" name="jdbc/MyDS" type="javax.sql.DataSource" />
<ResourceLink global="jdbc/MyDS" name="jdbc/EPATestDS" type="javax.sql.DataSource" />
<Parameter name="fileStore" value="/data/xxxx" override="false"/>
<Parameter name="logStore" value="/data/xxx" override="false"/>
<Parameter name="formSite" value="x" override="false"/>
<Parameter name="answerKeyStore" value="/data/xxxxx/EPA/key" override="false"/>
<Parameter name="debugMode" value="true" override="false"/>
<Parameter name="hostname" value="https://pre-xxxxxx.com" override="false"/>
<Parameter name="ssoHostname" value="https://pre-xxx.com" override="false"/>
<Parameter name="ssoRealm" value="xxx" override="false"/>
<Valve className="org.keycloak.adapters.tomcat.KeycloakAuthenticatorValve"/>
</Context>
<!--
These 2 parameters are expected to exist but are set for all applications on the tomcat server
<Parameter name="mailServer" value="xxxxxxx" override="false"/>
<Parameter name="xxxx" value="xxx" override="false"/>
-->
(all xxx's above are to remove identifying information)
and it seems illogical to add a line to be commented. However this context file isn't located where it seems to be indicated for most other questions I've seen on this topic. My file is located at /CATALINA_HOME/webapps/ROOT##104/META-INF/context.xml
whereas the solutions say to change it in /CATALINA_HOME/webapps/manager/META-INF/context.xml
. When I ls --file-type on webapps it gives the manager filetype as a symbolic link to /usr/local/tomcat/webapps/manager
which does not exist inside my /usr directory.
I believe the issue may be due to the way the site was configured/setup using docker, but I can't figure out the solution. The only places where /usr/local/tomcat/webapps/manager/META-INF/context.xml
are located are inside of ./var/lib/docker/
directories, and there are several warnings related to not changing these files as they are managed by docker. I am unsure of where to go at this point, but I do have Dockerfiles located I just don't know which/what is needed for context here. I am unsure if I need to build new images, etc. But I can say that restarting tomcat by issuing a docker exec to the container and restarting the container itself didn't cause any changes.
edit based on comment - You have the same var/lib/docker
path problems if you search for manager.xml
as suggested below
You can see a similar issue when looking to make changes to tomcat-users.xml
. This file only appears in directories under ./var/lib/docker/
or one other location, ./home/<username>/repo/tomcat/mec/files/tomcat-users.xml
. The file at this location does have a properly configured manager-gui role, but I am unsure if this is being communicated to the proper location.
Not being a seasoned veteran with docker I have limited scope on what the consequences would be of trying to make changes to images and build new containers, etc.
Overall I am just trying to get a view of my Java EE site currently on that development server and I may even be approaching this in the wrong manner. Any and all direction would be greatly appreciated; I am unfortunately taking this up after about 2 years of predecessor leaving and not maintaining.