5.8.3 Execution environment settings (When the Smart Composer functionality is used)
This section describes the settings for the error page customization.
- Organization of this subsection
(1) How to set
Define the association between the error status code and the error page in the following files:
-
Easy Setup definition file
Specify the error status code that you want to associate with the error page in the worker.worker-name.delegate_error_code parameter in the <configuration> tag of the logical Web server (web-server).
For details on the Easy Setup definition file and the parameters, see 4.3 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.
-
httpsd.conf
Associate the error status code and the file name of the corresponding error page in the ErrorDocument directive.
For details on httpsd.conf (HTTP Server definition file), see the uCosminexus Application Server HTTP Server User Guide.
(a) Precautions when specifying the error status codes
Take the following precautions when specifying the error status codes in the Easy Setup definition file:
-
Specify the error status code for each worker.
-
The worker type that can specify the error status code is only ajp13. If the worker type is lb (settings specified for load balancing based on the round-robin format) and post_size_lb (settings specified for distributing requests based on the POST data size), the specified contents are ignored.
-
The specifiable error status code is listed in the following table. The error page cannot be associated with error status codes other than the followings:
Table 5‒19: Error status codes that can be associated with error pages Error status codes
Explanation
400
Bad Request
401
Unauthorized
402
Payment Required
403
Forbidden
404
Not Found
405
Method Not Allowed
406
Not Acceptable
407
Proxy Authentication Required
408
Request Time-out
409
Conflict
410
Gone
411
Length Required
412
Precondition Failed
413
Request Entity Too Large
414
Request-URI Too Long
415
Unsupported Media Type
416
Requested Range Not Satisfiable
417
Expectation Failed
422
Unprocessible Entity
423
Locked
424
Failed Dependency
500
Internal Server Error
501
Not Implemented
502
Bad Gateway
503
Service Unavailable
504
Gateway Time-out
505
HTTP Version not supported
507
Insufficient Storage
510
Not Extended
(b) Precautions for specifying the ErrorDocument directive
Take the following precautions when you specify the ErrorDocument directive in httpsd.conf:
-
When using the local URL in the ErrorDocument directive, specify a URL that the redirector will not forward to the Web container.
-
When the URL pattern /* is mapped to a worker in the redirector settings such as for using the root context, all the requests are forwarded to the Web container. Therefore, in the ErrorDocument directive, set the resources on the Web container by using the complete URL.
The following is the example settings for displaying error404.jsp under the root context on the Web container when the root context is used and the error status code 404 occurs. The hostA is the host operating the Web server.
- Example:
-
ErrorDocument 404 http://hostA/error404.jsp
Also, when the Web container is not running, the redirector returns an error with error status code 500. Therefore, for customizing the error page when the Web container is not running, you must specify other Web server resources for the error status code 500 using the complete URL, in the ErrorDocument directive.
(2) Example settings
The following example describes the error page customization:
- Example of Easy Setup definition file
... <param> <param-name>worker.list</param-name> <param-value>worker1</param-value> </param> <param> <param-name>worker.worker1.type</param-name> <param-value>ajp13</param-value> </param> <param> <param-name>worker.worker1.host</param-name> <param-value>host1</param-value> </param> <param> <param-name>worker.worker1.delegate_error_code</param-name> <param-value>404</param-value> </param> ...
Define the error status code '404(Not Found)' in the worker.worker-name.delegate_error_code parameter.
- Example of httpsd.conf
# Description of httpsd.conf# # ... ErrorDocument 404 /missing.html
The error status code and the file name of the corresponding error page are associated. When an error with error status code '404(Not Found)' occurs, the missing.html file is displayed.
For details on the ErrorDocument directive, see the uCosminexus Application Server HTTP Server User Guide.