diff options
author | Anders Nordby <anders@FreeBSD.org> | 2001-11-12 03:24:59 +0000 |
---|---|---|
committer | Anders Nordby <anders@FreeBSD.org> | 2001-11-12 03:24:59 +0000 |
commit | 05cc414626152ff41f32cfff6b1f8af979e6ea08 (patch) | |
tree | e92b22a9080357c77a9e4b91df99fd2e53ec2c24 | |
parent | Add mod_mylo, a module for Apache that sends logs directly to a MySQL database (diff) |
Add mod_mysqluserdir, an Apache module to make Apache get userdirs from MySQL.
PR: 31577
Approved by: will
Notes
Notes:
svn path=/head/; revision=49956
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/mod_mysqluserdir/Makefile | 34 | ||||
-rw-r--r-- | www/mod_mysqluserdir/distinfo | 1 | ||||
-rw-r--r-- | www/mod_mysqluserdir/files/README | 45 | ||||
-rw-r--r-- | www/mod_mysqluserdir/files/patch-mod_mysqluserdir.c | 10 | ||||
-rw-r--r-- | www/mod_mysqluserdir/pkg-comment | 1 | ||||
-rw-r--r-- | www/mod_mysqluserdir/pkg-descr | 6 | ||||
-rw-r--r-- | www/mod_mysqluserdir/pkg-message | 19 | ||||
-rw-r--r-- | www/mod_mysqluserdir/pkg-plist | 5 |
9 files changed, 122 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index 5b4b4cc153f0..b0283e1196a5 100644 --- a/www/Makefile +++ b/www/Makefile @@ -151,6 +151,7 @@ SUBDIR += mod_layout SUBDIR += mod_mp3 SUBDIR += mod_mylo + SUBDIR += mod_mysqluserdir SUBDIR += mod_perl SUBDIR += mod_php3 SUBDIR += mod_php4 diff --git a/www/mod_mysqluserdir/Makefile b/www/mod_mysqluserdir/Makefile new file mode 100644 index 000000000000..a22220da2a3a --- /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 <anders@FreeBSD.org> +# +# $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 <bsd.port.mk> diff --git a/www/mod_mysqluserdir/distinfo b/www/mod_mysqluserdir/distinfo new file mode 100644 index 000000000000..06ab9dbd7460 --- /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 000000000000..eec557aa4a09 --- /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 000000000000..32e3c2f30783 --- /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 000000000000..2b69ffc5fef0 --- /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 000000000000..e892a0f539cd --- /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 <anders@FreeBSD.org> diff --git a/www/mod_mysqluserdir/pkg-message b/www/mod_mysqluserdir/pkg-message new file mode 100644 index 000000000000..31176a72a555 --- /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 000000000000..40157f263f96 --- /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 |