You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Jay Freeman (saurik)" <sa...@saurik.com> on 2000/07/27 21:50:03 UTC

[PATCH] mod_jk & Apache Auth/DirectoryIndex (was: [PATCHES] mod_jk)

Gomez:

Yes!  Nice to see I'm not crazy :).  I had mentioned that WAS_BORN_BY_APACHE
was causing me problems a month ago (along with a patch to remove it), and
no one seemed to agree it was a problem (and it was one of those that I
didn't put [PATCH] is the subject on so it didn't get as much attention from
the coders as it might have :)).

Regardless, the point of this message, another one of those small patches
from a month ago:

(also for the Apache1.3 version)

diff -u -r1.7 mod_jk.c
--- mod_jk.c    2000/06/30 08:10:46     1.7
+++ mod_jk.c    2000/07/27 19:43:06
@@ -882,7 +882,6 @@
             if(worker) {
                 r->handler = ap_pstrdup(r->pool, JK_HANDLER);
                 ap_table_setn(r->notes, JK_WORKER_ID, worker);
-                return OK;
             }
         }
     }

If mod_jk returns OK there Apache doesn't do authorization or DirectoryIndex
checks.  Removing that line makes mod_jk integrate with Apache much better
as before you would need a rewrite rule or a CGI script with a Location: to
allow http://www.mysite.com/ to go to index.jsp (or whatever else, maybe a
cocoon document).  It also keeps mod_jk from being above the regular
authorization schemes.

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

-----Original Message-----
From: GOMEZ Henri [mailto:hgomez@slib.fr]
Sent: Thursday, July 27, 2000 5:26 AM
To: tomcat-dev@jakarta.apache.org
Cc: Daniel Haischt
Subject: [PATCHES] mod_jk

Patches (from beta2) for Makefile.linux (apache1.3) and mod_jk.c (apache1.3)

PS: WAS_BORN_BY_APACHE stuff in mod_jk.c for apache 1.3.x didn't seems to do
what
    the author want. Removing it make mod_jk works on my Linux box.
    RPM come later this day ;-)


--- src/native/apache1.3/Makefile.linux.orig    Thu Jul 27 08:50:50 2000
+++ src/native/apache1.3/Makefile.linux Thu Jul 27 08:51:30 2000
@@ -1,37 +1,23 @@
 ## You need to edit this file - configure later :-)

-APACHE_HOME=/usr/local/apache
-OS=linux
-APXS=${APACHE_HOME}/bin/apxs
-
-A13_FLAGS=-I${APACHE_HOME}/include
-
 ## I assume this one is set up already
 # JAVA_HOME=
+OS=linux

-JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS}
-JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH}
-L${JAVA_HOME}/lib/${ARCH}/native_threads
-
-CFLAGS=-DHAVE_CONFIG_H -g -fpic  -DSHARED_MODULE -O2 -D_REENTRANT -pthread
-DLINUX -Wall
+JAVA_INCL=-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/${OS}
+JAVA_LIB=-L ${JAVA_HOME}/jre/lib/${ARCH} -L
${JAVA_HOME}/lib/${ARCH}/native_threads
+APXS=/usr/sbin/apxs

 JK=../jk/
-SRCS=jk_ajp12_worker.c jk_connect.c jk_msg_buff.c jk_util.c jk_ajp13.c \
-     jk_jni_worker.c jk_pool.c jk_worker.c jk_ajp13_worker.c jk_lb_worker.c
\
-     jk_sockbuf.c  jk_map.c jk_uri_worker_map.c
-
-
-OBJS=${patsubst %.c,%.o,${SRCS}}
-
-%.o: ../jk/%.c
-       ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@
+SRCS=../jk/jk_ajp12_worker.c ../jk/jk_connect.c ../jk/jk_msg_buff.c
../jk/jk_util.c ../jk/jk_ajp13.c \
+     ../jk/jk_jni_worker.c ../jk/jk_pool.c ../jk/jk_worker.c
../jk/jk_ajp13_worker.c ../jk/jk_lb_worker.c \
+     ../jk/jk_sockbuf.c  ../jk/jk_map.c ../jk/jk_uri_worker_map.c

-.c.o:
-       ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} -I../jk $<

 all: mod_jk.so

-mod_jk.so: ${OBJS} mod_jk.o
-       $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o
+mod_jk.so:
+       $(APXS) -I ../jk ${JAVA_INCL} -c -o $@ mod_jk.c $(SRCS)

 clean:
        rm *.o *.so


--- src/native/apache1.3/mod_jk.c.orig  Tue Jul 11 15:23:50 2000
+++ src/native/apache1.3/mod_jk.c       Thu Jul 27 08:43:36 2000
@@ -823,13 +823,10 @@

 static void jk_init(server_rec *s, ap_pool *p)
 {
-    char *env = getenv("WAS_BORN_BY_APACHE");
     jk_map_t *init_map = NULL;
     jk_server_conf_t *conf =
         (jk_server_conf_t *)ap_get_module_config(s->module_config,
&jk_module);

-    fprintf(stdout, "jk_post_config %s\n", env ? env : "NULL");
fflush(stdout);
-
     if(conf->log_file && conf->log_level >= 0) {
         if(!jk_open_file_logger(&(conf->log),
                                 conf->log_file,
@@ -850,14 +847,10 @@

     if(map_alloc(&init_map)) {
         if(map_read_properties(init_map, conf->worker_file)) {
-            if(!env) {
-                putenv("WAS_BORN_BY_APACHE=true");
-                return;
-            } else {
+               /* HGO20000727 - Removed WAS_BORN_BY_APACHE env test */
                 if(wc_open(init_map, conf->log)) {
                     return;
                 }
-            }
         }
     }


Regards