From d92b720042732f6ebfb169b626142abd0e48d993 Mon Sep 17 00:00:00 2001 From: anders Date: Mon, 12 Nov 2001 03:24:59 +0000 Subject: Add mod_mysqluserdir, an Apache module to make Apache get userdirs from MySQL. PR: 31577 Approved by: will --- www/mod_mysqluserdir/Makefile | 34 ++++++++++++++++ www/mod_mysqluserdir/distinfo | 1 + www/mod_mysqluserdir/files/README | 45 ++++++++++++++++++++++ .../files/patch-mod_mysqluserdir.c | 10 +++++ www/mod_mysqluserdir/pkg-comment | 1 + www/mod_mysqluserdir/pkg-descr | 6 +++ www/mod_mysqluserdir/pkg-message | 19 +++++++++ www/mod_mysqluserdir/pkg-plist | 5 +++ 8 files changed, 121 insertions(+) create mode 100644 www/mod_mysqluserdir/Makefile create mode 100644 www/mod_mysqluserdir/distinfo create mode 100644 www/mod_mysqluserdir/files/README create mode 100644 www/mod_mysqluserdir/files/patch-mod_mysqluserdir.c create mode 100644 www/mod_mysqluserdir/pkg-comment create mode 100644 www/mod_mysqluserdir/pkg-descr create mode 100644 www/mod_mysqluserdir/pkg-message create mode 100644 www/mod_mysqluserdir/pkg-plist (limited to 'www/mod_mysqluserdir') diff --git a/www/mod_mysqluserdir/Makefile b/www/mod_mysqluserdir/Makefile new file mode 100644 index 00000000000..a22220da2a3 --- /dev/null +++ b/www/mod_mysqluserdir/Makefile @@ -0,0 +1,34 @@ +# New ports collection makefile for: mod_mysqluserdir +# Date created: 12 November 2001 +# Whom: Anders Nordby +# +# $FreeBSD$ + +PORTNAME= mod_mysqluserdir +PORTVERSION= 0.1 +CATEGORIES= www +MASTER_SITES= ftp://sys.estpak.ee/pub/ \ + ftp://ftp.nuug.no/pub/anders/distfiles/ +DISTNAME= ${PORTNAME}_${PORTVERSION} + +MAINTAINER= anders@FreeBSD.org + +BUILD_DEPENDS= ${APXS}:${PORTSDIR}/www/apache13 +RUN_DEPENDS= ${APXS}:${PORTSDIR}/www/apache13 +LIB_DEPENDS= mysqlclient.10:${PORTSDIR}/databases/mysql323-client + +APXS= ${LOCALBASE}/sbin/apxs + +do-build: + (cd ${WRKSRC} && ${APXS} -c -I${LOCALBASE}/include \ + -L${LOCALBASE}/lib/mysql -lmysqlclient mod_mysqluserdir.c) + +do-install: + (cd ${WRKSRC} && ${APXS} -i -A -n 'userdir' mod_mysqluserdir.so) +.if !defined(NOPORTDOCS) + ${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR} + ${INSTALL_DATA} ${FILESDIR}/README ${DOCSDIR}/ +.endif + ${CAT} ${PKGMESSAGE} + +.include diff --git a/www/mod_mysqluserdir/distinfo b/www/mod_mysqluserdir/distinfo new file mode 100644 index 00000000000..06ab9dbd746 --- /dev/null +++ b/www/mod_mysqluserdir/distinfo @@ -0,0 +1 @@ +MD5 (mod_mysqluserdir_0.1.tar.gz) = 3f74bc9f8ce6959018767695c52c00c4 diff --git a/www/mod_mysqluserdir/files/README b/www/mod_mysqluserdir/files/README new file mode 100644 index 00000000000..eec557aa4a0 --- /dev/null +++ b/www/mod_mysqluserdir/files/README @@ -0,0 +1,45 @@ +Notes from the author: +====================== + +Modified by Jaanus Toomsalu for using MYSQL userdirs +03. Sept. 2001 +Configuration options + MyUserDirHost localhost - Mysql database host + MyUserDirSock /var/run/mysql/mysql.sock - Mysql Unix filesocket + if not present then database host option will be used + MyUserDirUser user - DB User + MyUserDirPass pass - DB User password + MyUserDirDB database _ DB name + MyUserDirTable table - DB table name + MyUserDirDirCol directory - directory column name + MyUserDirUserCol login - login column name + #MyUserDirLeftJoinCol - if needed + MyUserDirWhereCol "and enabled=1" + +Notes from Anders: +================== + +The module is successfully tested with this configuration: + +MyUserDirSock /tmp/mysql.sock +MyUserDirUser sqluserdir +MyUserDirPass foo +MyUserDirDB sqlusers +MyUserDirTable sqlusers +MyUserDirDirCol directory +MyUserDirUserCol user + +I had to disable the LoadModule and AddModule commands for the default Apache +mod_userdir to make mod_mysqluserdir work. + +And a MySQL table crated like this: + +CREATE TABLE sqlusers ( + id int(13) NOT NULL auto_increment, + user varchar(50) NOT NULL default '', + directory varchar(50) NOT NULL default '', + enabled tinyint(3) NOT NULL default '1', + PRIMARY KEY (id) +); + +INSERT INTO sqlusers VALUES (1,'anders','/home/anders',1); diff --git a/www/mod_mysqluserdir/files/patch-mod_mysqluserdir.c b/www/mod_mysqluserdir/files/patch-mod_mysqluserdir.c new file mode 100644 index 00000000000..32e3c2f3078 --- /dev/null +++ b/www/mod_mysqluserdir/files/patch-mod_mysqluserdir.c @@ -0,0 +1,10 @@ +--- mod_mysqluserdir.c.orig Sun Oct 28 14:08:24 2001 ++++ mod_mysqluserdir.c Sun Oct 28 14:08:53 2001 +@@ -614,7 +614,6 @@ + + if (sql_row=mysql_fetch_row(result)) { + values=sql_row[0]; +- mysql_free_result(result); + } + + else diff --git a/www/mod_mysqluserdir/pkg-comment b/www/mod_mysqluserdir/pkg-comment new file mode 100644 index 00000000000..2b69ffc5fef --- /dev/null +++ b/www/mod_mysqluserdir/pkg-comment @@ -0,0 +1 @@ +An Apache module to make Apache get userdirs from MySQL diff --git a/www/mod_mysqluserdir/pkg-descr b/www/mod_mysqluserdir/pkg-descr new file mode 100644 index 00000000000..e892a0f539c --- /dev/null +++ b/www/mod_mysqluserdir/pkg-descr @@ -0,0 +1,6 @@ +mod_mysqluserdir is a configurable Apache module for fetching +http://server/~username type info from a MySQL database. + +WWW: http://freshmeat.net/projects/mod_mysqluserdir/ + +- Anders Nordby diff --git a/www/mod_mysqluserdir/pkg-message b/www/mod_mysqluserdir/pkg-message new file mode 100644 index 00000000000..31176a72a55 --- /dev/null +++ b/www/mod_mysqluserdir/pkg-message @@ -0,0 +1,19 @@ +************************************************************ +You've installed mod_mysqluserdir, an Apache module to make +Apache get userdirs from MySQL. + +Edit your apache.conf or httpd.conf to enable and setup this +module. Have a look at the files in +${PREFIX}/share/doc/mod_mysqluserdir for information on how +to configure it etc. + +You need to disable the LoadModule and AddModule commands +for the default Apache mod_userdir module to make +mod_mysqluserdir work. + +Then do this to make it work effective: + +# apachectl configtest (see if there are any config errors) +# apachectl restart + +************************************************************ diff --git a/www/mod_mysqluserdir/pkg-plist b/www/mod_mysqluserdir/pkg-plist new file mode 100644 index 00000000000..40157f263f9 --- /dev/null +++ b/www/mod_mysqluserdir/pkg-plist @@ -0,0 +1,5 @@ +libexec/apache/mod_mysqluserdir.so +@exec %D/sbin/apxs -e -A -n userdir %D/%F +@unexec %D/sbin/apxs -e -A -n userdir %D/%F +%%PORTDOCS%%share/doc/mod_mysqluserdir/README +%%PORTDOCS%%@dirrm share/doc/mod_mysqluserdir -- cgit