Set a custom 'error 404' page location for items which use Apache Tomcat
search cancel

Set a custom 'error 404' page location for items which use Apache Tomcat

book

Article ID: 116386

calendar_today

Updated On:

Products

CA Client Automation - Asset Management CA Client Automation - IT Client Manager

Issue/Introduction

Tomcat resides in a location like 'C:\Program Files (x86)\CA\SC\Tomcat\8.0.26', but where the Tomcat Error Handling page can be configured?

When a user enters an invalid URL it would redirect them to a 404 error handling page. This location may need to be changed to address a potential security vulnerability or just to provide a custom page instead of the default.

Environment

Client Automation all supported versions

Cause

As this is not a problem or bug, there is no 'cause' of this other than a desire to change the default.

Resolution

What you really want is to know where you can specify a custom 404.html landing page.

To do that you need to edit the <error-page> section of 'Web.xml' with text like the following:

<error-page>
  <error-code>404</error-code>
  <location>/path/to/your/page.html</location>
</error-page>
 
This file exists in several locations such as CA\SC\Tomcat\Webapps\Manager, CA\SC\Tomcat\Webapps\ROOT and CA\DSM\WebConsole. as well as copies in other locations for CIC, ENC, Patch Manager etc. You just need to update the proper one for your needs.

Once updated and saved, you can recycle Tomcat via 'CAF TOP TOMCAT' followed by 'CAF START TOMCAT' run from an administrative command prompt and then you can test your changes in a web browser.