Problem
Default error messages reveal information about system and it's folder structure.
Solution
Customizing Tomcat error pages is described below.
You may want to use a panel to highlight important steps.- 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>
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. echo "ERROR - Customize this text as desired" > /usr/local/ubisecure/ubilogin-sso/ubilogin/webapps/ROOT/error.html Run update command and restart SSO Service /usr/local/ubisecure/ubilogin-sso/ubilogin/config/tomcat/update.sh service ubilogin-server restart
|
Related articles
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.