From e2dfccb52240fd943ec6f1f2b8260f86d24d4cd2 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Sun, 04 Jan 2004 03:23:22 +0000 Subject: update apache.m4 to use -with-apxs instead of --with-apache got SSL support to compile. added Documentation subdirectory. --- diff --git a/.cvsignore b/.cvsignore index d89a606..1149bb9 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,4 @@ +aclocal.m4 *.la .libs .deps diff --git a/CHANGELOG b/CHANGELOG index 9769044..c50eb29 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.3 2003/12/23 19:49:55 urkle Exp $ +$Id: CHANGELOG,v 1.4 2004/01/04 03:23:21 urkle Exp $ TODO: * Port connection portion to other DBMS? Genericize the module? Start with @@ -15,8 +15,14 @@ TODO: separate DB implimentation into sub-modules via provider mechanism * add document building to Makefile.in * backport patch for apache 1.3 +* investigate thread safety issues (libmysqlclient_r) +* Get SSL logging working with apache 2.0 CHANGES: +1.92: ? +* fixed compilation issue with mysql 4.x where mysql_error returns const char * +* added mysql import script by Aaron Jenson + 1.91: 2003-12-23 * Added checks for MySQL to autoconf * 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 @@ +# @configure_input@ + +# Modify these top variables. +SUBDIRS = + +EXTRA_DIST = README documentation.lyx + +#Don't modify anything below here + +srcdir = @abs_srcdir@ +builddir = @abs_builddir@ + +STD_DIST = Makefile.in + +DISTFILES = $(STD_DIST) $(EXTRA_DIST) + +all: all-subdirs + +all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: + @otarget=`echo $@|sed s/-subdirs//`; \ + list=' $(SUBDIRS)'; \ + for i in $$list; do \ + if test -d "$$i"; then \ + target="$$otarget"; \ + echo "Making $$target in $$i"; \ + if test "$$i" = "."; then \ + made_local=yes; \ + target="local-$$target"; \ + fi; \ + (cd $$i && $(MAKE) $$target) || exit 1; \ + fi; \ + done; \ + +include: + rm -rf include + ln -s @APACHE_INCDIR@ include + +install: install-subdirs + +update: update-subdirs + +clean: clean-subdirs + +distclean: clean distclean-subdirs + $(RM) Makefile + +DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@ +DESTTGZ = $(DESTDIR).tar.gz +dist: + @rm -rf $(DESTDIR); \ + list=' $(SUBDIRS)'; \ + for i in $$list; do \ + if test -d "$$i"; then \ + target=local-dist; \ + echo "Making $$target in $$i"; \ + if test "$$i" = "."; then \ + made_local=yes; \ + target="local-dist"; \ + fi; \ + NEWDESTDIR=$(builddir)/$(DESTDIR)/$$i; \ + echo $(NEWDESTDIR); \ + (cd $$i && $(MAKE) DESTDIR=$(builddir)/$(DESTDIR)/$$i $$target) || exit 1; \ + fi; \ + done; + if test "$$made_local" != "yes"; then \ + $(MAKE) "local-dist" || exit 1; \ + fi + tar -zcf $(DESTTGZ) $(DESTDIR) + rm -rf $(DESTDIR) + +local-dist: $(DISTFILES) + mkdir -p $(DESTDIR) + cp -dp --parents $(DISTFILES) $(DESTDIR) + +.PHONY: include all-subdirs update-subdirs install-subdirs \ + 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: fi; \ done; \ -TODO: TODO_HEADER $(SOURCES) $(HEADERS) - ./gen_todo.pl - $(TARGET): @APXS_BIN@ -c -o @PACKAGE_NAME@.la $(INCLUDES) $(CFLAGS) $(LDADD) @DEFS@ $(SOURCES) @@ -79,11 +76,11 @@ clean: clean-subdirs $(RM) $(OBJ) $(SLO) $(LO) $(TARGET) .deps distclean: clean distclean-subdirs - $(RM) TODO config.status config.log config.h config.h.in \ - configure stamp-h stamp-h.in Makefile + $(RM) config.status config.log config.h config.h.in \ + configure stamp-h stamp-h.in Makefile aclocal.m4 $(RM) -r autom4te-2.53.cache .libs -DESTDIR = @PACKAGE_TARNAME@-@PACKAGE_VERSION@ +DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@ DESTTGZ = $(DESTDIR).tar.gz dist: @rm -rf $(DESTDIR); \ @@ -115,7 +112,7 @@ $(builddir)/.deps: depend depend: $(SOURCES) $(HEADERS) if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \ - $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) $(srcdir)/*.c > $(builddir)/.deps || true; \ + $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) -DHAVE_CONFIG_H $(srcdir)/*.c > $(builddir)/.deps || true; \ fi include $(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 $AUTOHEADER $AUTOCONF touch stamp-h.in - -for x in providers/*; do - if [ -e $x/autogen.sh ]; then - echo Generating Config files in $x - (cd $x; ./autogen.sh $*) - fi -done 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, CHECK_PATH_MYSQL(:, AC_MSG_ERROR([*** Mysql client libraries not found!]) ) - +AC_CHECK_HEADERS(limits.h) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) dnl Write config.status and the Makefile -AC_OUTPUT(Makefile) +AC_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 @@ # Modify these top variables. SUBDIRS = -EXTRA_DIST = README documentation.lyx +EXTRA_DIST = README mysql_import_combined_log.pl #Don't modify anything below here @@ -14,7 +14,7 @@ STD_DIST = Makefile.in DISTFILES = $(STD_DIST) $(EXTRA_DIST) -all: $(TARGET) all-subdirs +all: all-subdirs all-subdirs install-subdirs update-subdirs clean-subdirs distclean-subdirs: @otarget=`echo $@|sed s/-subdirs//`; \ @@ -36,7 +36,6 @@ include: ln -s @APACHE_INCDIR@ include install: install-subdirs - @APXS_BIN@ -i -a -n $(subst mod_,,@PACKAGE_NAME@) $(TARGET) update: update-subdirs @@ -45,7 +44,7 @@ clean: clean-subdirs distclean: clean distclean-subdirs $(RM) Makefile -DESTDIR = @PACKAGE_TARNAME@-@PACKAGE_VERSION@ +DESTDIR = @PACKAGE_NAME@-@PACKAGE_VERSION@ DESTTGZ = $(DESTDIR).tar.gz dist: @rm -rf $(DESTDIR); \ @@ -73,14 +72,5 @@ local-dist: $(DISTFILES) mkdir -p $(DESTDIR) cp -dp --parents $(DISTFILES) $(DESTDIR) -$(builddir)/.deps: depend - -depend: $(SOURCES) $(HEADERS) - if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \ - $(CC) -MM -MT $(TARGET) -I@APACHE_INCDIR@ $(INCLUDES) $(srcdir)/*.c > $(builddir)/.deps || true; \ - fi - -include $(builddir)/.deps - .PHONY: include all-subdirs update-subdirs install-subdirs \ 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 AC_DEFUN(CHECK_PATH_APACHE, [dnl AC_ARG_WITH( - apache, - [ --with-apache[=DIR] Apache install root], - apache_prefix="$withval", - apache_prefix="/usr" + apxs, + [AC_HELP_STRING([--with-apxs[=DIR]],[Location to APXS binary])], + apxs_prefix="$withval", + apxs_prefix="/usr" ) -AC_ARG_ENABLE(apachetest, [ --disable-apachetest Do not try to compile and run apache version test program], - , enable_apachetest=yes) +AC_ARG_ENABLE(apachetest, + [AC_HELP_STRING([--disable-apachetest],[Do not try to compile and run apache version test program])], + , + enable_apachetest=yes) AC_REQUIRE([AC_CANONICAL_TARGET]) - PATH="$apache_prefix:$apache_prefix/bin:$apache_prefix/sbin:$PATH" + PATH="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin:$PATH" AC_PATH_PROG(APXS_BIN, apxs, no, [$PATH]) min_apache_version=ifelse([$1], ,1.3.1,$1) AC_MSG_CHECKING(for Apache - version >= $min_apache_version) @@ -80,7 +82,7 @@ int main (int argc, char *argv[]) major1, minor1, micro1); printf("*** I found version %d.%d.%d. Please verify the installation directory\n", major2, minor2, micro2); - printf("*** of apache with the --with-apache configure option.\n"); + printf("*** of apache with the --with-apxs configure option.\n"); return 1; } } @@ -97,7 +99,7 @@ int main (int argc, char *argv[]) if test "APXS_BIN" = "no" ; then echo "*** The apxs binary installed by apache could not be found" echo "*** If apache is installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or use the --with-apache configure option" + echo "*** your path, or use the --with-apxs configure option" else if test -f conf.apachetest ; then : 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 @@ -/* $Header: /home/cvs/mod_log_sql/mod_log_sql.c,v 1.5 2003/12/30 21:05:30 urkle Exp $ */ +/* $Header: /home/cvs/mod_log_sql/mod_log_sql.c,v 1.6 2004/01/04 03:23:21 urkle Exp $ */ /* --------* * DEFINES * * --------*/ @@ -31,16 +31,6 @@ #include "util_time.h" -#if APR_HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_LIMITS_H -#include -#endif - -#include "mysql.h" -#include "mysqld_error.h" - #ifdef HAVE_CONFIG_H /* Undefine these to prevent conflicts between Apache ap_config_auto.h and * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt. @@ -54,6 +44,16 @@ #include "config.h" #endif +#if APR_HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_LIMITS_H +#include +#endif + +#include "mysql.h" +#include "mysqld_error.h" + #ifdef WANT_SSL_LOGGING #include "mod_ssl.h" #endif @@ -178,11 +178,13 @@ static const char *extract_remote_user(request_rec *r, char *a) static const char *extract_ssl_keysize(request_rec *r, char *a) { char *result = NULL; + SSLConnRec *scc = myConnConfig(r->connection); + SSLSrvConfigRec *ssc = mySrvConfig(r->server); - if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { + if (myCtxConfig(scc,ssc) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); #ifdef DEBUG - ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_KEYSIZE: %s", result); + ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_KEYSIZE: %s", result); #endif if (result != NULL && result[0] == '\0') result = NULL; @@ -195,11 +197,13 @@ static const char *extract_ssl_keysize(request_rec *r, char *a) static const char *extract_ssl_maxkeysize(request_rec *r, char *a) { char *result = NULL; + SSLConnRec *scc = myConnConfig(r->connection); + SSLSrvConfigRec *ssc = mySrvConfig(r->server); - if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { + if (myCtxConfig(scc,ssc) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); #ifdef DEBUG - ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_ALGKEYSIZE: %s", result); + ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_ALGKEYSIZE: %s", result); #endif if (result != NULL && result[0] == '\0') result = NULL; @@ -212,11 +216,13 @@ static const char *extract_ssl_maxkeysize(request_rec *r, char *a) static const char *extract_ssl_cipher(request_rec *r, char *a) { char *result = NULL; + SSLConnRec *scc = myConnConfig(r->connection); + SSLSrvConfigRec *ssc = mySrvConfig(r->server); - if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) { + if (myCtxConfig(scc,ssc) != NULL) { result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); #ifdef DEBUG - ap_log_error(APLOG_MARK,APLOG_DEBUG,r->server,"SSL_CIPHER: %s", result); + ap_log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_CIPHER: %s", result); #endif if (result != NULL && result[0] == '\0') 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= module.source.expanded=1 module.source.files=\ mod_log_sql.c\ - make_combined_log.pl + make_combined_log.pl\ + contrib/mysql_import_combined_log.pl module.pixmap.name=. module.pixmap.type= @@ -73,7 +74,9 @@ module.data.expanded=1 module.data.files=\ Makefile.in\ configure.ac\ - create_tables.sql + create_tables.sql\ + Documentation/Makefile.in\ + contrib/Makefile.in module.help.name=. module.help.type= -- cgit v0.9.2