From f2fcb94f172ad16be6163c675a80b15103054a94 Mon Sep 17 00:00:00 2001 From: Clement Laforet Date: Fri, 9 Jan 2004 00:46:03 +0000 Subject: Add mod_cfg_ldap 1.0, allows you to keep your virtual host configuration in a LDAP directory and to make changes visible in nearly realtime. WWW: http://modcfgldap.sourceforge.net/ PR: 58256 Approved by: erwin (mentor) (implicitly) --- www/mod_cfg_ldap/Makefile | 41 ++++++++++++++++ www/mod_cfg_ldap/distinfo | 1 + www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c | 76 +++++++++++++++++++++++++++++ www/mod_cfg_ldap/pkg-descr | 4 ++ www/mod_cfg_ldap/pkg-plist | 4 ++ 5 files changed, 126 insertions(+) create mode 100644 www/mod_cfg_ldap/Makefile create mode 100644 www/mod_cfg_ldap/distinfo create mode 100644 www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c create mode 100644 www/mod_cfg_ldap/pkg-descr create mode 100644 www/mod_cfg_ldap/pkg-plist (limited to 'www/mod_cfg_ldap') diff --git a/www/mod_cfg_ldap/Makefile b/www/mod_cfg_ldap/Makefile new file mode 100644 index 000000000000..a7a295b94f50 --- /dev/null +++ b/www/mod_cfg_ldap/Makefile @@ -0,0 +1,41 @@ +# New ports collection makefile for: mod_cfg_ldap +# Date created: Sun Oct 19 +# Whom: Clement Laforet +# +# $FreeBSD$ +# + +PORTNAME= mod_cfg_ldap +PORTVERSION= 1.0 +CATEGORIES= www +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME:S/_//g} +DIST_SUBDIR= apache2 + +MAINTAINER= clement@FreeBSD.org +COMMENT= Allows you to keep your virtual host configuration in a LDAP directory + +USE_APACHE= YES +WITH_APACHE2= YES +USE_OPENLDAP= YES + +APXS?= ${LOCALBASE}/sbin/apxs +LDAP_INC?= ${LOCALBASE}/include +LDAP_LIB?= ${LOCALBASE}/lib -lldap + +PORTDOCS= AUTHORS cfg_ldap.conf ChangeLog COPYING INSTALL \ + mod_cfg_ldap.schema README TODO + +do-build: + @(cd ${WRKSRC} && ${APXS} -I ${LDAP_INC} -L ${LDAP_LIB} -c ${PORTNAME}.c) + +do-install: + @(cd ${WRKSRC} && ${APXS} -n ${PORTNAME:S/mod_//} -A -i ${PORTNAME}.la) +.if !defined (NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +. for f in ${PORTDOCS} + @${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +. endfor +.endif + +.include diff --git a/www/mod_cfg_ldap/distinfo b/www/mod_cfg_ldap/distinfo new file mode 100644 index 000000000000..67d88dc575f6 --- /dev/null +++ b/www/mod_cfg_ldap/distinfo @@ -0,0 +1 @@ +MD5 (apache2/mod_cfg_ldap-1.0.tar.gz) = 8e556a9cff882cb616db322f74f20355 diff --git a/www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c b/www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c new file mode 100644 index 000000000000..26a655bbba9d --- /dev/null +++ b/www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c @@ -0,0 +1,76 @@ +--- mod_cfg_ldap.c.orig Mon Nov 17 15:06:22 2003 ++++ mod_cfg_ldap.c Mon Nov 17 15:08:22 2003 +@@ -85,11 +85,11 @@ + cfg_ldap_init_ldap (apr_pool_t * p, server_rec * s) + { + cfg_ldap_cfg *cfg; ++ int rc; + cfg = + (cfg_ldap_cfg *) ap_get_module_config (s->module_config, + &cfg_ldap_module); + +- int rc; + ld = ldap_init (cfg->hostname, LDAP_PORT); + rc = ldap_simple_bind_s (ld, cfg->username, cfg->password); + +@@ -154,22 +154,30 @@ + cfg_ldap_read_vhost_from_ldap (apr_pool_t * p, server_rec * s, char *hostname) + { + cfg_ldap_cfg *cfg; ++ cfg_ldap_vhost *vhost; ++ char *filter; ++ int rc,count; ++ LDAPMessage *res; ++ LDAPMessage *entry; ++ char *attr; ++ BerElement *ber; ++ char **val = NULL; ++ char *vhost_name = NULL; ++ char *vhost_admin = NULL; ++ char *vhost_docroot = NULL; ++ + cfg = + (cfg_ldap_cfg *) ap_get_module_config (s->module_config, + &cfg_ldap_module); + +- cfg_ldap_vhost *vhost; + vhost = (cfg_ldap_vhost *) apr_pcalloc (p, sizeof (cfg_ldap_vhost)); + vhost->timestamp = apr_time_now (); + vhost->name = CFG_LDAP_NO_SUCH_VHOST; + +- char *filter; + filter = + apr_pstrcat (p, "(|(apacheServerName=", hostname, ")(apacheServerAlias=", + hostname, "))", NULL); + +- int rc; +- LDAPMessage *res; + rc = ldap_search_s (ld, cfg->basedn, LDAP_SCOPE_SUBTREE, filter, + (char **) &attrs, 0, &res); + +@@ -185,10 +193,9 @@ + return vhost; + } + +- LDAPMessage *entry; + entry = ldap_first_entry (ld, res); + +- int count = ldap_count_entries (ld, res); ++ count = ldap_count_entries (ld, res); + if (count == 0) + { + return vhost; +@@ -199,13 +206,6 @@ + "cfg_ldap: more than one entry for %s", hostname); + return vhost; + } +- +- char *attr; +- BerElement *ber; +- char **val = NULL; +- char *vhost_name = NULL; +- char *vhost_admin = NULL; +- char *vhost_docroot = NULL; + + for (attr = ldap_first_attribute (ld, entry, &ber); + attr != NULL; attr = ldap_next_attribute (ld, entry, ber)) diff --git a/www/mod_cfg_ldap/pkg-descr b/www/mod_cfg_ldap/pkg-descr new file mode 100644 index 000000000000..05c4f44d5dee --- /dev/null +++ b/www/mod_cfg_ldap/pkg-descr @@ -0,0 +1,4 @@ +mod_cfgldap can be used to keep VirtualHost configuration of the Apache web +server in a LDAP directory and to make changes visible in nearly realtime. + +WWW: http://modcfgldap.sourceforge.net/ diff --git a/www/mod_cfg_ldap/pkg-plist b/www/mod_cfg_ldap/pkg-plist new file mode 100644 index 000000000000..bbad32bbc7c1 --- /dev/null +++ b/www/mod_cfg_ldap/pkg-plist @@ -0,0 +1,4 @@ +libexec/apache2/mod_cfg_ldap.so +@exec %D/sbin/apxs -e -A -n cfg_ldap %D/%f +@unexec %D/sbin/apxs -e -A -n cfg_ldap %D/%f +@unexec echo "===> If you do not plan on reinstalling mod_cfg_ldap, you must manually remove"; echo "===> references to it in httpd.conf." -- cgit v1.2.3