Hi Glenn,
Could you update at least the apache2 connector ? This features makes
sense on all servers actually ( i.e. IIS, etc ) - but we should have it
at least in 1.3 and 2.0.
Also, any chance to update this on native2 ? I'll do it later if you don't
have the time.
Costin
On 21 Apr 2002 [EMAIL PROTECTED] wrote:
glenn 02/04/21 15:57:11
Modified:jk/native/apache-1.3 mod_jk.c
jk/native/common jk_logger.h jk_uri_worker_map.c jk_util.c
jk/doc mod_jk-howto.html
Log:
Apache mod_jk 1.2 new features.
Added JkRequestLogFormat for Apache style request logging
including Tocmat request latency in seconds and microseconds.
Added JkAutoAlias, this can be used to automatically Alias
web application context directories so that static files
can be served by Apache instead of Tomcat. When configured,
requests for a WAR file in the Tomcat appBase (webapps) directory
are forbidden. Requests for the WEB-INF and META-INF directories
within a web application context dir are also forbidden and will
return an HTTP 403 error.
Added ability to JkMount so that /*/servlet/ can be used to
configure mod_jk to pass all servlet requests on to Tomcat
for any web application context.
Revision ChangesPath
1.26 +521 -12 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
Index: mod_jk.c
===
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mod_jk.c3 Apr 2002 00:49:19 - 1.25
+++ mod_jk.c21 Apr 2002 22:57:11 - 1.26
@@ -61,7 +61,7 @@
* Author: Gal Shachor [EMAIL PROTECTED] *
* Dan Milstein [EMAIL PROTECTED]*
* Henri Gomez [EMAIL PROTECTED] *
- * Version: $Revision: 1.25 $ *
+ * Version: $Revision: 1.26 $ *
***/
/*
@@ -101,6 +101,7 @@
#define JK_WORKER_ID(jakarta.worker)
#define JK_HANDLER (jakarta-servlet)
+#define JK_DURATION (jakarta.worker.duration)
#define JK_MAGIC_TYPE (application/x-jakarta-servlet)
#define NULL_FOR_EMPTY(x) ((x !strlen(x)) ? NULL : x)
@@ -139,6 +140,18 @@
jk_uri_worker_map_t *uw_map;
/*
+ * Automatic context path apache alias
+ */
+char *alias_dir;
+
+/*
+ * Request Logging
+ */
+
+char *format_string;
+array_header *format;
+
+/*
* SSL Support
*/
int ssl_enable;
@@ -742,7 +755,7 @@
/*
* JkLogLevel Directive Handling
*
- * JkLogLevel debug/info/error/emerg
+ * JkLogLevel debug/info/request/error/emerg
*/
static const char *jk_set_log_level(cmd_parms *cmd,
@@ -773,6 +786,402 @@
}
/*
+ * JkAutoAlias Directive Handling
+ *
+ * JkAutoAlias application directory
+ */
+
+static const char *jk_set_auto_alias(cmd_parms *cmd,
+void *dummy,
+char *directory)
+{
+server_rec *s = cmd-server;
+jk_server_conf_t *conf =
+(jk_server_conf_t *)ap_get_module_config(s-module_config, jk_module);
+
+conf-alias_dir = directory;
+
+if (conf-alias_dir == NULL)
+return JkAutoAlias directory invalid;
+
+return NULL;
+}
+
+/*
+ *
+ * Actually logging.
+ */
+
+typedef const char *(*item_key_func) (request_rec *, char *);
+
+typedef struct {
+item_key_func func;
+char *arg;
+} request_log_format_item;
+
+static const char *process_item(request_rec *r,
+ request_log_format_item *item)
+{
+const char *cp;
+
+cp = (*item-func) (r,item-arg);
+return cp ? cp : -;
+}
+
+static int request_log_transaction(request_rec *r,
+ jk_server_conf_t *conf)
+{
+request_log_format_item *items;
+char *str, *s;
+int i;
+int len = 0;
+const char **strs;
+int *strl;
+array_header *format = conf-format;
+
+strs = ap_palloc(r-pool, sizeof(char *) * (format-nelts));
+strl = ap_palloc(r-pool, sizeof(int) * (format-nelts));
+items = (request_log_format_item *) format-elts;
+for (i = 0; i