/
Customize Tomcat error messages
Customize Tomcat error messages
Problem
Default error messages reveal information about system and it's folder structure.
Solution
Customizing Tomcat error pages is described below.
- Edit the following file.
- /usr/local/ubisecure/ubilogin-sso/ubilogin/config/tomcat/conf/web.xml
- Add the lines below to the end of the file, but within the XML markup. The error message must be customized separately for each error code, as it is done below.
- <error-page>
<error-code>400</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>401</error-code>
<location>/error.html</location></error-page>
<error-page>
<error-code>403</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>405</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>408</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>410</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>411</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>412</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>413</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>414</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>415</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>501</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>502</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<error-code>506</error-code><location>/error.html</location>
</error-page>
- <error-page>
- Copy the web.xml to the Tomcat work directory
- cp /usr/local/ubisecure/ubilogin-sso/ubilogin/config/tomcat/conf/web.xml
- /usr/local/ubisecure/ubilogin-sso/tomcat/conf/web.xml
- The customized error page is added with the name error.html. Customize as you wish.
- Run update command and restart SSO Service
- /usr/local/ubisecure/ubilogin-sso/ubilogin/config/tomcat/update.sh
- service ubilogin-server restart
- echo "ERROR - Customize this text as desired" > /usr/local/ubisecure/ubilogin-sso/ubilogin/webapps/ROOT/error.html
Related articles
, multiple selections available,
Related content
How-to
How-to
Read with this
Hide the Tomcat version number
Hide the Tomcat version number
More like this
Tightening user interface message security - SSO
Tightening user interface message security - SSO
More like this
Tightening user interface message security - SSO
Tightening user interface message security - SSO
More like this
Tightening user interface message security - SSO
Tightening user interface message security - SSO
More like this
Tightening user interface message security - SSO
Tightening user interface message security - SSO
More like this