Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2001 08:07:31 +0100 (CET)
From:      Anders Nordby <anders@fix.no>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/31577: New port: www/mod_mysqluserdir
Message-ID:  <20011029070731.127883D3C@totem.fix.no>

next in thread | raw e-mail | index | archive | help

>Number:         31577
>Category:       ports
>Synopsis:       New port: www/mod_mysqluserdir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 28 23:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anders Nordby
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Fluxpod Information eXchange
>Environment:

	<Relevant environment information (multiple lines)>

>Description:

New port of mod_mysqluserdir, an Apache module to make Apache get userdirs
from MySQL.

>How-To-Repeat:

	<Code/input/activities to reproduce the problem (multiple lines)>

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mod_mysqluserdir
#	mod_mysqluserdir/files
#	mod_mysqluserdir/files/README
#	mod_mysqluserdir/files/patch-mod_mysqluserdir.c
#	mod_mysqluserdir/distinfo
#	mod_mysqluserdir/pkg-descr
#	mod_mysqluserdir/pkg-plist
#	mod_mysqluserdir/pkg-comment
#	mod_mysqluserdir/Makefile
#	mod_mysqluserdir/pkg-message
#
echo c - mod_mysqluserdir
mkdir -p mod_mysqluserdir > /dev/null 2>&1
echo c - mod_mysqluserdir/files
mkdir -p mod_mysqluserdir/files > /dev/null 2>&1
echo x - mod_mysqluserdir/files/README
sed 's/^X//' >mod_mysqluserdir/files/README << 'END-of-mod_mysqluserdir/files/README'
XNotes from the author:
X======================
X
XModified by Jaanus Toomsalu for using MYSQL userdirs 
X03. Sept. 2001 
XConfiguration options
X   MyUserDirHost	 localhost	- Mysql database host
X   MyUserDirSock       /var/run/mysql/mysql.sock  - Mysql Unix filesocket
X	if not present then database host option will be used
X   MyUserDirUser       user		- DB User
X   MyUserDirPass       pass		- DB User password
X   MyUserDirDB         database	_ DB name
X   MyUserDirTable      table		- DB table name
X   MyUserDirDirCol     directory	- directory column name
X   MyUserDirUserCol    login		- login column name
X   #MyUserDirLeftJoinCol 		- if needed
X   MyUserDirWhereCol   "and enabled=1"
X
XNotes from Anders:
X==================
X
XThe module is successfully tested with this configuration:
X
XMyUserDirSock  /tmp/mysql.sock
XMyUserDirUser  sqluserdir
XMyUserDirPass  foo
XMyUserDirDB    sqlusers
XMyUserDirTable sqlusers
XMyUserDirDirCol        directory
XMyUserDirUserCol       user
X
XI had to disable the LoadModule and AddModule commands for the default Apache
Xmod_userdir to make mod_mysqluserdir work.
X
XAnd a MySQL table crated like this:
X
XCREATE TABLE sqlusers (
X  id int(13) NOT NULL auto_increment,
X  user varchar(50) NOT NULL default '',
X  directory varchar(50) NOT NULL default '',
X  enabled tinyint(3) NOT NULL default '1',
X  PRIMARY KEY  (id)
X);
X
XINSERT INTO sqlusers VALUES (1,'anders','/home/anders',1);
END-of-mod_mysqluserdir/files/README
echo x - mod_mysqluserdir/files/patch-mod_mysqluserdir.c
sed 's/^X//' >mod_mysqluserdir/files/patch-mod_mysqluserdir.c << 'END-of-mod_mysqluserdir/files/patch-mod_mysqluserdir.c'
X--- mod_mysqluserdir.c.orig	Sun Oct 28 14:08:24 2001
X+++ mod_mysqluserdir.c	Sun Oct 28 14:08:53 2001
X@@ -614,7 +614,6 @@
X 
X 	if (sql_row=mysql_fetch_row(result)) {
X 		values=sql_row[0];
X-		mysql_free_result(result);
X 		}
X 
X 	else	
END-of-mod_mysqluserdir/files/patch-mod_mysqluserdir.c
echo x - mod_mysqluserdir/distinfo
sed 's/^X//' >mod_mysqluserdir/distinfo << 'END-of-mod_mysqluserdir/distinfo'
XMD5 (mod_mysqluserdir_0.1.tar.gz) = 3f74bc9f8ce6959018767695c52c00c4
END-of-mod_mysqluserdir/distinfo
echo x - mod_mysqluserdir/pkg-descr
sed 's/^X//' >mod_mysqluserdir/pkg-descr << 'END-of-mod_mysqluserdir/pkg-descr'
Xmod_mysqluserdir is a configurable Apache module for fetching
Xhttp://server/~username type info from a MySQL database.
X
XWWW: http://freshmeat.net/projects/mod_mysqluserdir/
X
X- Anders Nordby <anders@fix.no>
END-of-mod_mysqluserdir/pkg-descr
echo x - mod_mysqluserdir/pkg-plist
sed 's/^X//' >mod_mysqluserdir/pkg-plist << 'END-of-mod_mysqluserdir/pkg-plist'
Xlibexec/apache/mod_mysqluserdir.so
X@exec %D/sbin/apxs -e -A -n userdir %D/%F
X@unexec %D/sbin/apxs -e -A -n userdir %D/%F
X%%PORTDOCS%%share/doc/mod_mysqluserdir/README
X%%PORTDOCS%%@dirrm share/doc/mod_mysqluserdir
END-of-mod_mysqluserdir/pkg-plist
echo x - mod_mysqluserdir/pkg-comment
sed 's/^X//' >mod_mysqluserdir/pkg-comment << 'END-of-mod_mysqluserdir/pkg-comment'
XAn Apache module to make Apache get userdirs from MySQL
END-of-mod_mysqluserdir/pkg-comment
echo x - mod_mysqluserdir/Makefile
sed 's/^X//' >mod_mysqluserdir/Makefile << 'END-of-mod_mysqluserdir/Makefile'
X# New ports collection makefile for:	mod_mysqluserdir
X# Date created:				28 October 2001
X# Whom:					Anders Nordby <anders@fix.no>
X#
X# $FreeBSD$
X
XPORTNAME=	mod_mysqluserdir
XPORTVERSION=	0.1
XCATEGORIES=	www
XMASTER_SITES=	ftp://sys.estpak.ee/pub/ \
X		ftp://ftp.nuug.no/pub/anders/distfiles/
XDISTNAME=	${PORTNAME}_${PORTVERSION}
X
XMAINTAINER=	anders@fix.no
X
XBUILD_DEPENDS=	${APXS}:${PORTSDIR}/www/apache13
XRUN_DEPENDS=	${APXS}:${PORTSDIR}/www/apache13
XLIB_DEPENDS=	mysqlclient.10:${PORTSDIR}/databases/mysql323-client
X
XAPXS=		${LOCALBASE}/sbin/apxs
X
Xdo-build:
X	(cd ${WRKSRC} && ${APXS} -c -I${LOCALBASE}/include \
X	-L${LOCALBASE}/lib/mysql -lmysqlclient mod_mysqluserdir.c)
X
Xdo-install:
X	(cd ${WRKSRC} && ${APXS} -i -A -n 'userdir' mod_mysqluserdir.so)
X.if !defined(NOPORTDOCS)
X	${INSTALL} -d -o root -g wheel -m 0755 ${DOCSDIR}
X	${INSTALL_DATA} ${FILESDIR}/README ${DOCSDIR}/
X.endif
X	${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-mod_mysqluserdir/Makefile
echo x - mod_mysqluserdir/pkg-message
sed 's/^X//' >mod_mysqluserdir/pkg-message << 'END-of-mod_mysqluserdir/pkg-message'
X************************************************************
XYou've installed mod_mysqluserdir, an Apache module to make
XApache get userdirs from MySQL.
X
XEdit your apache.conf or httpd.conf to enable and setup this
Xmodule. Have a look at the files in
X${PREFIX}/share/doc/mod_mysqluserdir for information on how
Xto configure it etc.
X
XYou need to disable the LoadModule and AddModule commands
Xfor the default Apache mod_userdir module to make
Xmod_mysqluserdir work.
X
XThen do this to make it work effective:
X
X# apachectl configtest (see if there are any config errors)
X# apachectl restart
X
X************************************************************
END-of-mod_mysqluserdir/pkg-message
exit

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011029070731.127883D3C>