[Ultrapossum-cvs 1193] projects/apache ...

アーカイブの一覧に戻る

Masato Taruishi taru****@users*****
2005年 1月 29日 (土) 19:37:24 JST


===================================================================
RCS file: projects/apache/10apache,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- projects/apache/10apache	2004/11/01 05:51:26	1.3
+++ projects/apache/10apache	2005/01/29 10:37:22	1.4
@@ -23,9 +23,13 @@
 # Defining Variables
 if test "x$cache" = "x"; then
 
+  # Apache suite
+  APACHE_SUITES=$(ultrapossum_getconf APACHE_SUITES "`cd $sysconfdir; /bin/ls -d apache*`")
+
   APACHE_HOSTS=$(ultrapossum_getconf APACHE_HOSTS "$HOST")
-  APACHE_HTTPDCONF=$(ultrapossum_getconf APACHE_HTTPDCONF "/etc/apache/httpd.conf")
-  APACHE_DOCUMENTROOT=$(ultrapossum_getconf APACHE_DOCUMENTROOT "`grep ^DocumentRoot $APACHE_HTTPDCONF  | head -1 | awk -F' ' '{print $2;}'`")
+  APACHE_HTTPDCONF=$(ultrapossum_getconf APACHE_HTTPDCONF "httpd.conf")
+  APACHE_DOCUMENTROOT=$(ultrapossum_getconf APACHE_DOCUMENTROOT "`grep ^DocumentRoot $sysconfdir/$(echo $APACHE_SUITES | cut -d' ' -f1)/$APACHE_HTTPDCONF  | head -1 | awk -F' ' '{print $2;}'`")
+
 
   # Virtual host configuration
   VHOSTSDIR=$(ultrapossum_getconf VHOSTDIR "$localstatedir/lib/$PACKAGE/org")
@@ -37,6 +41,8 @@
   APACHE_VHOSTIN=$(ultrapossum_getconf APACHE_VHOSTIN "$TEMPLATEDIR/vhost_alias.in")
   APACHE_VDOCUMENTROOT=$(ultrapossum_getconf APACHE_VDOCUMENTROOT "$VHOSTSDIR/$VHOSTHASH/$APACHE_DOCUMENTROOT/")
   APACHE_VSCRIPTALIAS=$(ultrapossum_getconf APACHE_VSCRIPTALIAS "$VHOSTSDIR/$VHOSTHASH/$APACHE_DOCUMENTROOT/cgi-bin")
+
+  APACHE_AUTHLDAPIN=$(ultrapossum_getconf APACHE_AUTHLDAPIN "$TEMPLATEDIR/auth_ldap.in")
 
   HTTP_PROVIDER=$(ultrapossum_getconf HTTP_PROVIDER "")
 fi
===================================================================
RCS file: projects/apache/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- projects/apache/Makefile.am	2004/11/01 05:51:26	1.2
+++ projects/apache/Makefile.am	2005/01/29 10:37:22	1.3
@@ -9,7 +9,7 @@
 update_SCRIPTS = update-apache
 
 modulelocal_SCRIPTS = vhosthash
-template_DATA = vhost_alias.in
+template_DATA = vhost_alias.in auth_ldap.in
 
 EXTRA_DIST = update-apache \
 	apache.cf \
===================================================================
RCS file: projects/apache/update-apache,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- projects/apache/update-apache	2004/11/01 05:51:26	1.4
+++ projects/apache/update-apache	2005/01/29 10:37:22	1.5
@@ -27,12 +27,16 @@
 . $SHAREDIR/plugin
 
 configure_debian() {
-  apache-modconf apache enable mod_vhost_alias
+  if test "x$APACHE_VHOSTS" != "x"; then
+    apache-modconf "$1" enable mod_vhost_alias
+  fi
+  apache-modconf "$1" enable auth_ldap
 }
 
 remove_debian() {
   :
-  #  apache-modconf apache disable mod_vhost_alias
+  # apache-modconf apache disable mod_vhost_alias
+  # apache-modconf apache enable auth_ldap
 }
 
 
@@ -41,26 +45,51 @@
 }
 
 configure() {
-  install -d $VHOSTSDIR
   add_startmark "##" "$id" > $tmp
-  if test -e "$APACHE_VHOSTIN"; then
-    $SHAREDIR/sedwrap < "$APACHE_VHOSTIN" >> $tmp
+
+  # Virtual Host
+  if test "x$APACHE_VHOSTS" != "x"; then
+    progress "Configuring virtual host... "
+
+    if test -e "$APACHE_VHOSTIN"; then
+      $SHAREDIR/sedwrap < "$APACHE_VHOSTIN" >> $tmp
+    fi
+    
+    install -d $VHOSTSDIR
+    for h in $APACHE_VHOSTS
+    do
+      install -d $VHOSTSDIR/`$MODULEDIR/apache/vhosthash $h $VHOSTHASH`/var/www
+    done
+    install -d `dirname $APACHE_VHOSTSLOG`
+    progress "Configuring virtual host... done"
+  fi
+
+  # auth_ldap
+  if test -f "$APACHE_AUTHLDAPIN"; then
+    progress "Configuring auth_ldap... "
+    $SHAREDIR/sedwrap < "$APACHE_AUTHLDAPIN" >> $tmp
+    progress "Configuring auth_ldap... done"
   fi
   add_endmark "##" "$id" >> $tmp
-  add_end_vaconf "$APACHE_HTTPDCONF" "$tmp" "$id"
-  install -d `dirname $APACHE_VHOSTSLOG`
 
-  for h in $APACHE_VHOSTS
+  for s in $APACHE_SUITES
   do
-    install -d $VHOSTSDIR/`$MODULEDIR/apache/vhosthash $h $VHOSTHASH`/var/www
+    progress "Configuring $s..."
+    add_end_vaconf "$sysconfdir/$s/$APACHE_HTTPDCONF" "$tmp" "$id"
+    configure_debian "$s"
+    progress "Configuring $s... done"
   done
 
-  configure_debian
 }
 
 remove() {
-  strip_vaconf "$APACHE_HTTPDCONF" "$id"
-  remove_debian
+  for s in $APACHE_SUITES
+  do
+    progress "Removing $s..."
+    strip_vaconf "$sysconfdir/$s/$APACHE_HTTPDCONF" "$id"
+    remove_debian "$s"
+    progress "Removing $s... done"
+  done
 }
 
 update "$1"



Ultrapossum-cvs メーリングリストの案内
アーカイブの一覧に戻る