2

I'm running a Tomcat 6.0.28 at port 8080 in a Debian Squeeze box. I'm a newbie in tomcat.

I would like to change the location of manager and host-manager applications. That is, instead of going to:

http://myserver:8080/manager/html

I would like that to be:

http://myserver:8080/somesubdirectory/manager/html

Is this possible? If yes, how can I achieve this? I would really appreciate any help in this.

I've been trying to change the context of /etc/tomcat6/Catalina/localhost/manager.xml from /manager to /somesubdirectory/manager with no success. Also I tried to create a symlink under /var/lib/tomcat6/webapps/ROOT/somesubdirectory/manager with no success.

Thanks in advance.

Cheers.

4 Answers 4

2
  1. Stop Tomcat.
  2. Empty the work directory.
  3. Rename $CATALINA_BASE/webapps/manager to $CATALINA_BASE/webapps/somesubdirectory#manager
  4. Start Tomcat.

See http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Automatic_Application_Deployment and look for "Multi-level contexts" for further details.

2

Steps to change Tomcat's /manager to /hello123

  1. sudo mv $CATALINA_BASE/webapps/manager $CATALINA_BASE/webapps/hello123

  2. update docBase in /etc/tomcat6/Catalina/localhost/manager.xml, points to above /hello123

  3. sudo mv manager.xml hello123.xml

  4. sudo service restrat tomcat

Done. Refer to this article how to change Tomcat manager webapp path for detail.

1

Do this (from now on, I assume we're in the tomcat root directory) :

  1. Copy the webapps/manager directory to webapps/somesubdirectory
  2. Open the webapps/somesubdirectory/WEB-INF/web.xml file with a text editor
  3. To every "url-pattern" occurrence, add the "/manager" string. So for example, this: <url-pattern>/html/*</url-pattern> becomes this: <url-pattern>/manager/html/*</url-pattern>. Save the file.

  4. Restart tomcat

1
  • Thanks Lacek. I did that and restarted tomcat but if I try to go to myserver:8080/somesubdirectory/manager/html this error appears: Status HTTP 404 - /subdirectory/manager/html is not available. Commented Mar 7, 2011 at 19:51
0

With Tomcat 9 (on Ubuntu/Debian) just go to the path /etc/tomcat9/Catalina/localhost and rename the manager.xml.

e.g. rename it to:

  • manager2.xml for http://example.com/manager2
  • subdir#manager.xmlfor http://example.com/subdir/manager

cf. https://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Naming for the naming rules

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.