26

using this tutorial http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php#install_viewer

And it tells me to display the Tomcat manager application through this link http://localhost:8080/manager/html.

However when I click it I get an error from my browser saying it could not connect. Why is this? How exactly does one display the Tomcat Manager Application

1
  • 1
    First check you are looking in the good $CATALINA_BASE and $CATALINA_HOME, then make sure your have the manager folder in your $CATALINA_BASE/webapps/. See: stackoverflow.com/a/47717619/3495031
    – forzagreen
    Dec 8, 2017 at 15:54

7 Answers 7

23

If you are launching tomcat from within Eclipse (using the webtools tomcat server adapter) you will have to make sure you have changed the settings to use the installation directory to launch instead of the default which uses a separate location for loading and deploying webapps. So just having the manager in your webapps in the tomcat installation wont be enough to see the manager since by default tomcat launched by Eclipse doesn't look for apps in the webapps folder.

Just make sure that catalina.base and catalina.home point to the tomcat installation directory

2
  • 1
    how do I set catalina.base and catalina.home?
    – Anthony
    Nov 26, 2013 at 17:52
  • 5
    In Eclipse Luna, in the Servers view, open your Tomcat server (double-click to open). Under 'Server Locations', select 'Use Tomcat installation (takes control of Tomcat installation)'. May 9, 2015 at 14:34
7

I solved that problem by setting up the server management in Eclipse to take control of the Tomcat installation, which has the manager enabled. This thread explains how to do it:

Tomcat started in Eclipse but unable to connect to http://localhost:8085/

Anyway I have the console at the address you mentioned:

localhost:8080/manager/html

in Tomcat 7.

1
  • this should simply be a community wiki (as it's basically just a referral) and an accepted answer. Dec 12, 2023 at 7:05
2
Below things worked for me on fresh installation of apache-tomcat-7.0.63 -

Please make changes to below files and restart the server using %CATALINA_HOME%\bin>catalina.bat start and then try -   
http://localhost:8080/manager/html

            1) configured variables - CATALINA_HOME and CATALINA_BASE

            2) created manager.xml file inside %CATALINA_HOME%\conf\Catalina\localhost

            please paste below lines into manager.xml file -

               <Context privileged="true" antiResourceLocking="false"
                     docBase="${catalina.home}/webapps/manager">
                  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
                     allow="127\.0\.0\.1" />
               </Context>

            3) modified %CATALINA_HOME%\conf\tomcat-users.xml file

            please paste below lines into tomcat-users.xml file

              <role rolename="manager-gui"/>
              <role rolename="manager-script"/>
              <role rolename="manager-jmx"/>
              <role rolename="manager-status"/>
              <role rolename="admin-gui"/>
              <role rolename="admin-script"/>
              <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

            4) modified %CATALINA_HOME%\conf\server.xml

            Search this line '<Engine name="Catalina" defaultHost="localhost">' and add below line after that -
            <Realm className="org.apache.catalina.realm.MemoryRealm" /> 
1
  • thumbs up this comprehensive instruction: eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\manager.xml was the key in my case
    – tsohr
    Dec 7, 2016 at 10:30
1

Make sure you activated the manager app and created a user that has access to it. For details see the documentation to your Tomcat-Version (e.g. for Tomcat 7: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html )

1

Hey this issue just took me a lot of time to fix, so my tips would be (if it's relevant to others that view this page as well):

  1. Use command line commands (set CATALINA_HOME etc..) instead of changing it through control panel enviroment variables.

  2. When people use %.....% it means give the path to the folder of this variable, except the folder which you are at in command promplt. For example if you are in C:\ in command line and someone tells you to do %CATALINA_HOME%\bin, assuming for example the path for CATALINA_HOME is C:\Program Files, it means write in command line: Pragram Files\bin (excluding C:).

Could have saved me a lot of time.

1
  1. Right Click On Apache Tomcat
  2. Select Open
  3. Go to Server Locations Tab
  4. Select use tomcat installation
  5. Goto the installation directory
  6. Edit apache-tomcat-8.0/conf/tomcat-users.xml
  7. Add the below users in the xml file

    <role rolename="tomcat"/> <role rolename="manager-gui"/> <role rolename="manager"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="tomcat" password="tomcat" roles="tomcat,manager-gui,manager"/>

  8. Copy tomcat-user.xml file in eclipse workspace server's tomcat directory

  9. Now open tomcat manager page http://localhost:/manager/html/
  10. Use username and password tomcat and manager page will open on your browser
0

If you want to keep using the workspace metadata for you Eclipse Tomcat instance, here's how you can get the manager webapp to work.

The base configuration instructions can be found in Apache Tomcat 7 Manager App HOW-TO.

In your Servers IDE project, the <server name>-config\server.xml file should have the following nested entries:

...
<Service name="Catalina">
  ...
  <Engine defaultHost="localhost" name="Catalina">
    ...
    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
    ...

Open your Eclipse workspace metadata, where the Tomcat instance folders are published, i.e.:

<your-workspace-dir>\.metadata\.plugins\org.eclipse.wst.server.core\tmp<n>

there, inside the conf\ folder create a new folder named Catalina (derived from <Engine ... name="Catalina"> above), inside this folder create another one named localhost (derived from <Host ... name="localhost" ...> above) and in this last one edit a file named manager.xml with the content as per the linked docs:

<Context privileged="true" antiResourceLocking="false"
         docBase="${catalina.home}/webapps/manager">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.0\.0\.1" />
</Context>

Now publish and start the server instance, the manager will be deployed along side the other webapps you have added — for me it is the last one being deployed.

Tested with Tomcat 7, but I guess it would work for any Tomcat version that supports that linked configuration.


Side note

Do not create the above mentioned folders and files inside the configuration stored in the Eclipse Servers project, they won't be published in the org.eclipse.wst.server.core\tmp<n>\conf directory.

1
  • You know, that sounds like a worthwhile feature request.
    – nitind
    Jul 28, 2023 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.