Hi,

how can I customize Apache's error page if mod_jk2 does not get a usable
worker (Tomcat is down)?

Using Apache 2.0.47, mod_jk2 2.0.2 and Tomcat 4.1.24 running on Linux I
get an error message when the servlet engine is stopped (Tomcat is
down):


The servlet container is temporary unavailable or being upgraded Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server error
log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.


httpd.conf defines:


ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var

This document (HTTP_INTERNAL_SERVER_ERROR.html.var) is shown when I try
to execute a CGI script missing its x-bit in filesystem access rights.


The first sentence ("The servlet container is temporary unavailable or being upgraded") comes from mod_jk2 (jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2/common/jk_worker_lb.c):

#define NO_WORKER_MSG "The servlet container is temporary unavailable or
being upgraded\n";


The next paragraphs are hardcoded into Apache (httpd-2.0.47/modules/http/http_protocol.c, get_canned_error_string()):

    default:                    /* HTTP_INTERNAL_SERVER_ERROR */
        /*
         * This comparison to expose error-notes could be modified to
         * use a configuration directive and export based on that
         * directive.  For now "*" is used to designate an error-notes
         * that is totally safe for any user to see (ie lacks paths,
         * database passwords, etc.)
         */
        if (((error_notes = apr_table_get(r->notes,
                                          "error-notes")) != NULL)
            && (h1 = apr_table_get(r->notes, "verbose-error-to")) !=
NULL
            && (strcmp(h1, "*") == 0)) {
            return(apr_pstrcat(p, error_notes, "<p />\n", NULL));
        }
        else {
            return(apr_pstrcat(p,
                               "<p>The server encountered an internal "
                               "error or\n"
                               "misconfiguration and was unable to
complete\n"
                               "your request.</p>\n"
                               "<p>Please contact the server "
                               "administrator,\n ",
                               ap_escape_html(r->pool,
                                              r->server->server_admin),
                               " and inform them of the time the "
                               "error occurred,\n"
                               "and anything you might have done that "
                               "may have\n"
                               "caused the error.</p>\n"
                               "<p>More information about this error "
                               "may be available\n"
                               "in the server error log.</p>\n",
                               NULL));
        }


The last sentence comes from ap_send_error_response() in httpd-2.0.47/modules/http/http_protocol.c:

        if (recursive_error) {
            ap_rvputs_proto_in_ascii(r, "<p>Additionally, a ",

status_lines[ap_index_of_response(recursive_error)],
                      "\nerror was encountered while trying to use an "
                      "ErrorDocument to handle the request.</p>\n",
NULL);
        }


Regards, Bernie



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to