diff options
author | clement <clement@FreeBSD.org> | 2004-01-09 08:46:03 +0800 |
---|---|---|
committer | clement <clement@FreeBSD.org> | 2004-01-09 08:46:03 +0800 |
commit | 4897f0d495b6dfc30bfdcd9f5d19da41a4281819 (patch) | |
tree | 16c9c588366c70c31174c65700db19329013644e | |
parent | 02044a21f40189acf4edce7025b1752888720c7b (diff) | |
download | freebsd-ports-gnome-4897f0d495b6dfc30bfdcd9f5d19da41a4281819.tar.gz freebsd-ports-gnome-4897f0d495b6dfc30bfdcd9f5d19da41a4281819.tar.zst freebsd-ports-gnome-4897f0d495b6dfc30bfdcd9f5d19da41a4281819.zip |
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)
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/mod_cfg_ldap/Makefile | 41 | ||||
-rw-r--r-- | www/mod_cfg_ldap/distinfo | 1 | ||||
-rw-r--r-- | www/mod_cfg_ldap/files/patch-mod_cfg_ldap.c | 76 | ||||
-rw-r--r-- | www/mod_cfg_ldap/pkg-descr | 4 | ||||
-rw-r--r-- | www/mod_cfg_ldap/pkg-plist | 4 |
6 files changed, 127 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index b258362f654f..fbf711dff6a7 100644 --- a/www/Makefile +++ b/www/Makefile @@ -211,6 +211,7 @@ SUBDIR += mod_blosxom SUBDIR += mod_blowchunks SUBDIR += mod_bunzip2 + SUBDIR += mod_cfg_ldap SUBDIR += mod_cgi_debug SUBDIR += mod_color SUBDIR += mod_csacek 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 <sheepkiller@cultdeadsheep.org> +# +# $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 <bsd.port.mk> 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." |