summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-01-04 03:23:22 +0000
committerGravatar Edward Rudd 2004-01-04 03:23:22 +0000
commite2dfccb52240fd943ec6f1f2b8260f86d24d4cd2 (patch)
treee9576f43acacc69993ab369c0f608cefcedf8ae2
parent5b0927ae5d90380ac043f66787e253b03d218319 (diff)
update apache.m4 to use -with-apxs instead of --with-apache
got SSL support to compile. added Documentation subdirectory.
-rw-r--r--.cvsignore1
-rw-r--r--CHANGELOG8
-rw-r--r--Documentation/.cvsignore1
-rw-r--r--Documentation/Makefile.in76
-rw-r--r--Makefile.in11
-rwxr-xr-xautogen.sh7
-rw-r--r--configure.ac4
-rw-r--r--contrib/.cvsignore1
-rw-r--r--contrib/Makefile.in16
-rw-r--r--contrib/README1
-rw-r--r--m4/apache.m420
-rw-r--r--mod_log_sql.c40
-rw-r--r--mod_log_sql.prj7
13 files changed, 135 insertions, 58 deletions
diff --git a/.cvsignore b/.cvsignore
index d89a606..1149bb9 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,3 +1,4 @@
1aclocal.m4
1*.la 2*.la
2.libs 3.libs
3.deps 4.deps
diff --git a/CHANGELOG b/CHANGELOG
index 9769044..c50eb29 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
1$Id: CHANGELOG,v 1.3 2003/12/23 19:49:55 urkle Exp $ 1$Id: CHANGELOG,v 1.4 2004/01/04 03:23:21 urkle Exp $
2 2
3TODO: 3TODO:
4* Port connection portion to other DBMS? Genericize the module? Start with 4* Port connection portion to other DBMS? Genericize the module? Start with
@@ -15,8 +15,14 @@ TODO:
15 separate DB implimentation into sub-modules via provider mechanism 15 separate DB implimentation into sub-modules via provider mechanism
16* add document building to Makefile.in 16* add document building to Makefile.in
17* backport patch for apache 1.3 17* backport patch for apache 1.3
18* investigate thread safety issues (libmysqlclient_r)
19* Get SSL logging working with apache 2.0
18 20
19CHANGES: 21CHANGES:
221.92: ?
23* fixed compilation issue with mysql 4.x where mysql_error returns const char *
24* added mysql import script by Aaron Jenson
25
201.91: 2003-12-23 261.91: 2003-12-23
21* Added checks for MySQL to autoconf 27* Added checks for MySQL to autoconf
22* fixed merge code to work correctly. 28* fixed merge code to work correctly.
diff --git a/Documentation/.cvsignore b/Documentation/.cvsignore
new file mode 100644
index 0000000..f3c7a7c
--- /dev/null
+++ b/Documentation/.cvsignore
@@ -0,0 +1 @@
Makefile
diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in
new file mode 100644
index 0000000..2d07cfd
--- /dev/null
+++ b/Documentation/Makefile.in
@@ -0,0 +1,76 @@
1# @configure_input@
2
3# Modify these top variables.
4SUBDIRS =
5
6EXTRA_DIST = README documentation.lyx
7
8#Don't modify anything below here
9
10srcdir = @abs_srcdir@
11builddir = @abs_builddir@
12
13STD_DIST = Makefile.in
14
15DISTFILES = $(STD_DIST) $(EXTRA_DIST)
16
17all: all-subdirs
18
19all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs:
20 @otarget=`echo $@|sed s/-subdirs//`; \
21 list=' $(SUBDIRS)'; \
22 for i in $$list; do \
23 if test -d "$$i"; then \
24 target="$$otarget"; \
25 echo "Making $$target in $$i"; \
26 if test "$$i" = "."; then \
27 made_local=yes; \
28 target="local-$$target"; \
29 fi; \
30 (cd $$i && $(MAKE) $$target) || exit 1; \
31 fi; \
32 done; \
33
34include:
35 rm -rf include
36 ln -s @APACHE_INCDIR@ include
37
38install: install-subdirs
39
40update: update-subdirs
41
42clean: clean-subdirs
43
44distclean: clean distclean-subdirs
45 $(RM) Makefile
46
47DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@
48DESTTGZ = $(DESTDIR).tar.gz
49dist:
50 @rm -rf $(DESTDIR); \
51 list=' $(SUBDIRS)'; \
52 for i in $$list; do \
53 if test -d "$$i"; then \
54 target=local-dist; \
55 echo "Making $$target in $$i"; \
56 if test "$$i" = "."; then \
57 made_local=yes; \
58 target="local-dist"; \
59 fi; \
60 NEWDESTDIR=$(builddir)/$(DESTDIR)/$$i; \
61 echo $(NEWDESTDIR); \
62 (cd $$i && $(MAKE) DESTDIR=$(builddir)/$(DESTDIR)/$$i $$target) || exit 1; \
63 fi; \
64 done;
65 if test "$$made_local" != "yes"; then \
66 $(MAKE) "local-dist" || exit 1; \
67 fi
68 tar -zcf $(DESTTGZ) $(DESTDIR)
69 rm -rf $(DESTDIR)
70
71local-dist: $(DISTFILES)
72 mkdir -p $(DESTDIR)
73 cp -dp --parents $(DISTFILES) $(DESTDIR)
74
75.PHONY: include all-subdirs update-subdirs install-subdirs \
76 clean-subdirs distclean-subdirs dist
diff --git a/Makefile.in b/Makefile.in
index 08b0bfa..e3c7142 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -59,9 +59,6 @@ all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs:
59 fi; \ 59 fi; \
60 done; \ 60 done; \
61 61
62TODO: TODO_HEADER $(SOURCES) $(HEADERS)
63 ./gen_todo.pl
64
65$(TARGET): 62$(TARGET):
66 @APXS_BIN@ -c -o @PACKAGE_NAME@.la $(INCLUDES) $(CFLAGS) $(LDADD) @DEFS@ $(SOURCES) 63 @APXS_BIN@ -c -o @PACKAGE_NAME@.la $(INCLUDES) $(CFLAGS) $(LDADD) @DEFS@ $(SOURCES)
67 64
@@ -79,11 +76,11 @@ clean: clean-subdirs
79 $(RM) $(OBJ) $(SLO) $(LO) $(TARGET) .deps 76 $(RM) $(OBJ) $(SLO) $(LO) $(TARGET) .deps
80 77
81distclean: clean distclean-subdirs 78distclean: clean distclean-subdirs
82 $(RM) TODO config.status config.log config.h config.h.in \ 79 $(RM) config.status config.log config.h config.h.in \
83 configure stamp-h stamp-h.in Makefile 80 configure stamp-h stamp-h.in Makefile aclocal.m4
84 $(RM) -r autom4te-2.53.cache .libs 81 $(RM) -r autom4te-2.53.cache .libs
85 82
86DESTDIR = @PACKAGE_TARNAME@-@PACKAGE_VERSION@ 83DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@
87DESTTGZ = $(DESTDIR).tar.gz 84DESTTGZ = $(DESTDIR).tar.gz
88dist: 85dist:
89 @rm -rf $(DESTDIR); \ 86 @rm -rf $(DESTDIR); \
@@ -115,7 +112,7 @@ $(builddir)/.deps: depend
115 112
116depend: $(SOURCES) $(HEADERS) 113depend: $(SOURCES) $(HEADERS)
117 if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \ 114 if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
118 $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) $(srcdir)/*.c > $(builddir)/.deps || true; \ 115 $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) -DHAVE_CONFIG_H $(srcdir)/*.c > $(builddir)/.deps || true; \
119 fi 116 fi
120 117
121include $(builddir)/.deps 118include $(builddir)/.deps
diff --git a/autogen.sh b/autogen.sh
index 9ae9c6b..78f11a7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -14,10 +14,3 @@ $ACLOCAL -I m4
14$AUTOHEADER 14$AUTOHEADER
15$AUTOCONF 15$AUTOCONF
16touch stamp-h.in 16touch stamp-h.in
17
18for x in providers/*; do
19 if [ -e $x/autogen.sh ]; then
20 echo Generating Config files in $x
21 (cd $x; ./autogen.sh $*)
22 fi
23done
diff --git a/configure.ac b/configure.ac
index 56f648c..84fbf96 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,10 +17,10 @@ CHECK_PATH_APACHE($APACHE_VERSION,
17CHECK_PATH_MYSQL(:, 17CHECK_PATH_MYSQL(:,
18 AC_MSG_ERROR([*** Mysql client libraries not found!]) 18 AC_MSG_ERROR([*** Mysql client libraries not found!])
19 ) 19 )
20 20AC_CHECK_HEADERS(limits.h)
21 21
22AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) 22AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
23 23
24dnl Write config.status and the Makefile 24dnl Write config.status and the Makefile
25 25
26AC_OUTPUT(Makefile) 26AC_OUTPUT(Makefile Documentation/Makefile)
diff --git a/contrib/.cvsignore b/contrib/.cvsignore
new file mode 100644
index 0000000..f3c7a7c
--- /dev/null
+++ b/contrib/.cvsignore
@@ -0,0 +1 @@
Makefile
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
index ca70e2f..c40a711 100644
--- a/contrib/Makefile.in
+++ b/contrib/Makefile.in
@@ -3,7 +3,7 @@
3# Modify these top variables. 3# Modify these top variables.
4SUBDIRS = 4SUBDIRS =
5 5
6EXTRA_DIST = README documentation.lyx 6EXTRA_DIST = README mysql_import_combined_log.pl
7 7
8#Don't modify anything below here 8#Don't modify anything below here
9 9
@@ -14,7 +14,7 @@ STD_DIST = Makefile.in
14 14
15DISTFILES = $(STD_DIST) $(EXTRA_DIST) 15DISTFILES = $(STD_DIST) $(EXTRA_DIST)
16 16
17all: $(TARGET) all-subdirs 17all: all-subdirs
18 18
19all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: 19all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs:
20 @otarget=`echo $@|sed s/-subdirs//`; \ 20 @otarget=`echo $@|sed s/-subdirs//`; \
@@ -36,7 +36,6 @@ include:
36 ln -s @APACHE_INCDIR@ include 36 ln -s @APACHE_INCDIR@ include
37 37
38install: install-subdirs 38install: install-subdirs
39 @APXS_BIN@ -i -a -n $(subst mod_,,@PACKAGE_NAME@) $(TARGET)
40 39
41update: update-subdirs 40update: update-subdirs
42 41
@@ -45,7 +44,7 @@ clean: clean-subdirs
45distclean: clean distclean-subdirs 44distclean: clean distclean-subdirs
46 $(RM) Makefile 45 $(RM) Makefile
47 46
48DESTDIR = @PACKAGE_TARNAME@-@PACKAGE_VERSION@ 47DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@
49DESTTGZ = $(DESTDIR).tar.gz 48DESTTGZ = $(DESTDIR).tar.gz
50dist: 49dist:
51 @rm -rf $(DESTDIR); \ 50 @rm -rf $(DESTDIR); \
@@ -73,14 +72,5 @@ local-dist: $(DISTFILES)
73 mkdir -p $(DESTDIR) 72 mkdir -p $(DESTDIR)
74 cp -dp --parents $(DISTFILES) $(DESTDIR) 73 cp -dp --parents $(DISTFILES) $(DESTDIR)
75 74
76$(builddir)/.deps: depend
77
78depend: $(SOURCES) $(HEADERS)
79 if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
80 $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) $(srcdir)/*.c > $(builddir)/.deps || true; \
81 fi
82
83include $(builddir)/.deps
84
85.PHONY: include all-subdirs update-subdirs install-subdirs \ 75.PHONY: include all-subdirs update-subdirs install-subdirs \
86 clean-subdirs distclean-subdirs dist 76 clean-subdirs distclean-subdirs dist
diff --git a/contrib/README b/contrib/README
new file mode 100644
index 0000000..7dac946
--- /dev/null
+++ b/contrib/README
@@ -0,0 +1 @@
This directory contains contributed scripts/programs/utilites related to mod_log_sql.
diff --git a/m4/apache.m4 b/m4/apache.m4
index b74f335..8f0d200 100644
--- a/m4/apache.m4
+++ b/m4/apache.m4
@@ -4,17 +4,19 @@ dnl
4AC_DEFUN(CHECK_PATH_APACHE, 4AC_DEFUN(CHECK_PATH_APACHE,
5[dnl 5[dnl
6AC_ARG_WITH( 6AC_ARG_WITH(
7 apache, 7 apxs,
8 [ --with-apache[=DIR] Apache install root], 8 [AC_HELP_STRING([--with-apxs[=DIR]],[Location to APXS binary])],
9 apache_prefix="$withval", 9 apxs_prefix="$withval",
10 apache_prefix="/usr" 10 apxs_prefix="/usr"
11 ) 11 )
12AC_ARG_ENABLE(apachetest, [ --disable-apachetest Do not try to compile and run apache version test program], 12AC_ARG_ENABLE(apachetest,
13 , enable_apachetest=yes) 13 [AC_HELP_STRING([--disable-apachetest],[Do not try to compile and run apache version test program])],
14 ,
15 enable_apachetest=yes)
14 16
15 17
16 AC_REQUIRE([AC_CANONICAL_TARGET]) 18 AC_REQUIRE([AC_CANONICAL_TARGET])
17 PATH="$apache_prefix:$apache_prefix/bin:$apache_prefix/sbin:$PATH" 19 PATH="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin:$PATH"
18 AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH]) 20 AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH])
19 min_apache_version=ifelse([$1], ,1.3.1,$1) 21 min_apache_version=ifelse([$1], ,1.3.1,$1)
20 AC_MSG_CHECKING(for Apache - version >= $min_apache_version) 22 AC_MSG_CHECKING(for Apache - version >= $min_apache_version)
@@ -80,7 +82,7 @@ int main (int argc, char *argv[])
80 major1, minor1, micro1); 82 major1, minor1, micro1);
81 printf("*** I found version %d.%d.%d. Please verify the installation directory\n", 83 printf("*** I found version %d.%d.%d. Please verify the installation directory\n",
82 major2, minor2, micro2); 84 major2, minor2, micro2);
83 printf("*** of apache with the --with-apache configure option.\n"); 85 printf("*** of apache with the --with-apxs configure option.\n");
84 return 1; 86 return 1;
85 } 87 }
86} 88}
@@ -97,7 +99,7 @@ int main (int argc, char *argv[])
97 if test "APXS_BIN" = "no" ; then 99 if test "APXS_BIN" = "no" ; then
98 echo "*** The apxs binary installed by apache could not be found" 100 echo "*** The apxs binary installed by apache could not be found"
99 echo "*** If apache is installed in PREFIX, make sure PREFIX/bin is in" 101 echo "*** If apache is installed in PREFIX, make sure PREFIX/bin is in"
100 echo "*** your path, or use the --with-apache configure option" 102 echo "*** your path, or use the --with-apxs configure option"
101 else 103 else
102 if test -f conf.apachetest ; then 104 if test -f conf.apachetest ; then
103 : 105 :
diff --git a/mod_log_sql.c b/mod_log_sql.c
index 7ec2100..64896ab 100644
--- a/mod_log_sql.c
+++ b/mod_log_sql.c
@@ -1,4 +1,4 @@
1/* $Header: /home/cvs/mod_log_sql/mod_log_sql.c,v 1.5 2003/12/30 21:05:30 urkle Exp $ */ 1/* $Header: /home/cvs/mod_log_sql/mod_log_sql.c,v 1.6 2004/01/04 03:23:21 urkle Exp $ */
2/* --------* 2/* --------*
3 * DEFINES * 3 * DEFINES *
4 * --------*/ 4 * --------*/
@@ -31,16 +31,6 @@
31 31
32#include "util_time.h" 32#include "util_time.h"
33 33
34#if APR_HAVE_UNISTD_H
35#include <unistd.h>
36#endif
37#ifdef HAVE_LIMITS_H
38#include <limits.h>
39#endif
40
41#include "mysql.h"
42#include "mysqld_error.h"
43
44#ifdef HAVE_CONFIG_H 34#ifdef HAVE_CONFIG_H
45/* Undefine these to prevent conflicts between Apache ap_config_auto.h and 35/* Undefine these to prevent conflicts between Apache ap_config_auto.h and
46 * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt. 36 * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt.
@@ -54,6 +44,16 @@
54#include "config.h" 44#include "config.h"
55#endif 45#endif
56 46
47#if APR_HAVE_UNISTD_H
48#include <unistd.h>
49#endif
50#ifdef HAVE_LIMITS_H
51#include <limits.h>
52#endif
53
54#include "mysql.h"
55#include "mysqld_error.h"
56
57#ifdef WANT_SSL_LOGGING 57#ifdef WANT_SSL_LOGGING
58#include "mod_ssl.h" 58#include "mod_ssl.h"
59#endif 59#endif
@@ -178,11 +178,13 @@ static const char *extract_remote_user(request_rec *r, char *a)
178static const char *extract_ssl_keysize(request_rec *r, char *a) 178static const char *extract_ssl_keysize(request_rec *r, char *a)
179{ 179{
180 char *result = NULL; 180 char *result = NULL;
181 SSLConnRec *scc = myConnConfig(r->connection);
182 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
181 183
182 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { 184 if (myCtxConfig(scc,ssc) != NULL) {
183 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); 185 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE");
184 #ifdef DEBUG 186 #ifdef DEBUG
185 ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_KEYSIZE: %s", result); 187 ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_KEYSIZE: %s", result);
186 #endif 188 #endif
187 if (result != NULL && result[0] == '\0') 189 if (result != NULL && result[0] == '\0')
188 result = NULL; 190 result = NULL;
@@ -195,11 +197,13 @@ static const char *extract_ssl_keysize(request_rec *r, char *a)
195static const char *extract_ssl_maxkeysize(request_rec *r, char *a) 197static const char *extract_ssl_maxkeysize(request_rec *r, char *a)
196{ 198{
197 char *result = NULL; 199 char *result = NULL;
200 SSLConnRec *scc = myConnConfig(r->connection);
201 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
198 202
199 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { 203 if (myCtxConfig(scc,ssc) != NULL) {
200 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); 204 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE");
201 #ifdef DEBUG 205 #ifdef DEBUG
202 ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_ALGKEYSIZE: %s", result); 206 ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_ALGKEYSIZE: %s", result);
203 #endif 207 #endif
204 if (result != NULL && result[0] == '\0') 208 if (result != NULL && result[0] == '\0')
205 result = NULL; 209 result = NULL;
@@ -212,11 +216,13 @@ static const char *extract_ssl_maxkeysize(request_rec *r, char *a)
212static const char *extract_ssl_cipher(request_rec *r, char *a) 216static const char *extract_ssl_cipher(request_rec *r, char *a)
213{ 217{
214 char *result = NULL; 218 char *result = NULL;
219 SSLConnRec *scc = myConnConfig(r->connection);
220 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
215 221
216 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { 222 if (myCtxConfig(scc,ssc) != NULL) {
217 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); 223 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER");
218 #ifdef DEBUG 224 #ifdef DEBUG
219 ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_CIPHER: %s", result); 225 ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_CIPHER: %s", result);
220 #endif 226 #endif
221 if (result != NULL && result[0] == '\0') 227 if (result != NULL && result[0] == '\0')
222 result = NULL; 228 result = NULL;
diff --git a/mod_log_sql.prj b/mod_log_sql.prj
index 774fb61..7fa3b1b 100644
--- a/mod_log_sql.prj
+++ b/mod_log_sql.prj
@@ -60,7 +60,8 @@ module.source.type=
60module.source.expanded=1 60module.source.expanded=1
61module.source.files=\ 61module.source.files=\
62 mod_log_sql.c\ 62 mod_log_sql.c\
63 make_combined_log.pl 63 make_combined_log.pl\
64 contrib/mysql_import_combined_log.pl
64 65
65module.pixmap.name=. 66module.pixmap.name=.
66module.pixmap.type= 67module.pixmap.type=
@@ -73,7 +74,9 @@ module.data.expanded=1
73module.data.files=\ 74module.data.files=\
74 Makefile.in\ 75 Makefile.in\
75 configure.ac\ 76 configure.ac\
76 create_tables.sql 77 create_tables.sql\
78 Documentation/Makefile.in\
79 contrib/Makefile.in
77 80
78module.help.name=. 81module.help.name=.
79module.help.type= 82module.help.type=