4.9.2 How to set directives
Following examples describe the settings of each directive for the flow-restricting functionality:
- Organization of this subsection
(1) Rejecting requests by limiting the number of server processes (server threads)
The following shows an example of rejecting requests by limiting the number of server processes (server threads). In this example, if the number of server processes (server threads) that are currently processing requests is 13, new requests are rejected with the status code 503.
-
UNIX version
MaxClients 15 QOSRejectionServers 2 QOSCookieServers 0
-
Windows version
ThreadsPerChild 15 QOSRejectionServers 2 QOSCookieServers 0
(2) Session management using cookies
The session management performed by using cookies provides the HWS creation mode, in which the cookies generated on HTTP Server are used, and the user creation mode, in which the cookies generated on external modules other than on HTTP Server are used. You can select which mode is to be used by using the QOSCookieName directive.
- HWS creation mode
-
When a request process is executed, the cookie generated on HTTP Server is added to the Set-Cookie response header. Requests with a cookie generated by HTTP Server are processed with a higher priority than requests without cookies.
- User creation mode
-
When a cookie which is not generated by HTTP Server is added to the Set-Cookie header, flow restriction is performed by using the cookie. Requests with the cookie are processed with a higher priority than requests without cookies.
If you specify the following, and if the number of requested server threads is 10, the server will deny a new session request without cookie, however, the server will process a maintenance session with cookie. If the number of requested server threads is 13, the server will deny the request regardless of the cookie. This example is performed in the HWS creation mode.
-
UNIX version
MaxClients 15 QOSRejectionServers 2 QOSCookieServers 5
-
Windows version
ThreadsPerChild 15 QOSRejectionServers 2 QOSCookieServers 5
(3) Redirect
When the flow-restricting functionality denies a request process the server returns a response message with the status code 503. However, you can redirect the request to some other Web server by specifying the following. If a request for /index.html is denied from the flow-restricting functionality, index.html of the www1.hitachi.co.jp Web server is set in the response header, and the request is returned with the status code 302:
QOSRedirect /index.html http://www1.hitachi.co.jp/index.html
(4) Customizing the response message
If you specify the following, the contents of htdocs/busy.html are returned in the response message with the status code 503, as the response for the denied request.
QOSResponse file "text/html; charset=ISO-8859-1" htdocs/busy.html