[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello, welcome, here's a diff



Here's the changes I made from 1.3.22-3 to 1.3.22-4.  If anyone
sees something they don't like, please shout.

diff -u apache-1.3.22/info/210mod_access.info apache-1.3.22/info/210mod_access.info
--- apache-1.3.22/info/210mod_access.info
+++ apache-1.3.22/info/210mod_access.info
@@ -1,6 +1,6 @@
 LoadModule: access_module /usr/lib/apache/1.3/mod_access.so
 Directives:
- allow
- deny
- order
+ Allow
+ Deny
+ Order
 Description: Support for host-based access control
diff -u apache-1.3.22/contrib/mod_autoindex/mod_autoindex.c apache-1.3.22/contrib/mod_autoindex/mod_autoindex.c
--- apache-1.3.22/contrib/mod_autoindex/mod_autoindex.c
+++ apache-1.3.22/contrib/mod_autoindex/mod_autoindex.c
@@ -95,7 +95,9 @@
 #define SUPPRESS_PREAMBLE 64
 #define SUPPRESS_COLSORT 128
 #define NO_OPTIONS 256
-#define STUDLY_INDEXING 512
+#define FOLDERS_FIRST 512
+#define TRACK_MODIFIED 1024
+#define STUDLY_INDEXING 2048
 
 #define K_PAD 1
 #define K_NOPAD 0
@@ -125,6 +127,7 @@
  * Other default dimensions.
  */
 #define DEFAULT_NAME_WIDTH 23
+#define DEFAULT_DESC_WIDTH 23
 
 struct item {
     char *type;
@@ -148,6 +151,8 @@
     int decremented_opts;
     int name_width;
     int name_adjust;
+    int desc_width;
+    int desc_adjust;
     int icon_width;
     int icon_height;
     char *default_order;
@@ -447,6 +452,12 @@
         else if (!strcasecmp(w, "SuppressColumnSorting")) {
             option = SUPPRESS_COLSORT;
 	}
+	else if (!strcasecmp(w, "FoldersFirst")) {
+	    option = FOLDERS_FIRST;
+	}
+	else if (!strcasecmp(w, "TrackModified")) {
+	    option = TRACK_MODIFIED;
+	}
 	else if (!strcasecmp(w, "None")) {
 	    if (action != '\0') {
 		return "Cannot combine '+' or '-' with 'None' keyword";
@@ -508,6 +519,31 @@
 		d_cfg->name_adjust = K_NOADJUST;
 	    }
 	}
+	else if (!strcasecmp(w, "DescriptionWidth")) {
+	    if (action != '-') {
+		return "DescriptionWidth with no value may only appear as "
+		       "'-DescriptionWidth'";
+	    }
+	    d_cfg->desc_width = DEFAULT_DESC_WIDTH;
+	    d_cfg->desc_adjust = K_NOADJUST;
+	}
+	else if (!strncasecmp(w, "DescriptionWidth=", 17)) {
+	    if (action == '-') {
+		return "Cannot combine '-' with DescriptionWidth=n";
+	    }
+	    if (w[17] == '*') {
+		d_cfg->desc_adjust = K_ADJUST;
+	    }
+	    else {
+		int width = atoi(&w[17]);
+
+		if (width < 12) {
+		    return "DescriptionWidth value must be greater than 12";
+		}
+		d_cfg->desc_width = width;
+		d_cfg->desc_adjust = K_NOADJUST;
+	    }
+	}
 	else if (!strncasecmp(w, "BodyColor=", 10)) {
 	    if (action == '-') {
 		return "Cannot combine '-' with BodyColor=#xxxxxx";
@@ -665,6 +701,8 @@
     new->icon_height = 0;
     new->name_width = DEFAULT_NAME_WIDTH;
     new->name_adjust = K_UNSET;
+    new->desc_width = DEFAULT_DESC_WIDTH;
+    new->desc_adjust = K_UNSET;
     new->icon_list = ap_make_array(p, 4, sizeof(struct item));
     new->alt_list = ap_make_array(p, 4, sizeof(struct item));
     new->desc_list = ap_make_array(p, 4, sizeof(ai_desc_t));
@@ -758,6 +796,17 @@
 	new->name_width = add->name_width;
 	new->name_adjust = add->name_adjust;
     }
+    /*
+     * Likewise for DescriptionWidth.
+     */
+    if (add->desc_adjust == K_UNSET) {
+	new->desc_width = base->desc_width;
+	new->desc_adjust = base->desc_adjust;
+    }
+    else {
+	new->desc_width = add->desc_width;
+	new->desc_adjust = add->desc_adjust;
+    }
 
     new->default_order = (add->default_order != NULL)
 	? add->default_order : base->default_order;
@@ -796,12 +845,14 @@
     time_t lm;
     struct ent *next;
     int ascending;
+    int isdir;
+    int checkdir;
     char key;
 };
 
 static char *find_item(request_rec *r, array_header *list, int path_only)
 {
-    const char *content_type = r->content_type;
+    const char *content_type = ap_field_noparam(r->pool, r->content_type);
     const char *content_encoding = r->content_encoding;
     char *path = r->filename;
 
@@ -1085,6 +1136,10 @@
     }
     return -1;
 }
+
+/* See mod_include */
+#define SUB_REQ_STRING  "Sub request to mod_include"
+#define PARENT_STRING   "Parent request to mod_include"
     
 /*
  * Handle the preamble through the H1 tag line, inclusive.  Locate
@@ -1129,6 +1184,11 @@
 		if (! (autoindex_opts & SUPPRESS_PREAMBLE)) {
 		    emit_preamble(r, title, autoindex_conf);
 		}
+
+		/* See mod_include */
+		ap_table_add(r->notes, PARENT_STRING, "");
+		ap_table_add(rr->notes, SUB_REQ_STRING, "");
+
 		/*
 		 * If there's a problem running the subrequest, display the
 		 * preamble if we didn't do it before -- the header file
@@ -1139,6 +1199,7 @@
 		    emit_amble = autoindex_opts & SUPPRESS_PREAMBLE;
 		    emit_H1 = 1;
 		}
+		ap_table_unset(r->notes, PARENT_STRING);	/* cleanup */
 	    }
 	    else if (!strncasecmp("text/", rr->content_type, 5)) {
 		/*
@@ -1222,11 +1283,17 @@
 	if (rr->content_type != NULL) {
 	    if (!strcasecmp(ap_field_noparam(r->pool, rr->content_type),
 			    "text/html")) {
+
+		/* See mod_include */
+		ap_table_add(r->notes, PARENT_STRING, "");
+		ap_table_add(rr->notes, SUB_REQ_STRING, "");
+
 		if (ap_run_sub_req(rr) == OK) {
 		    /* worked... */
 		    suppress_sig = 1;
 		    suppress_post = autoindex_opts & SUPPRESS_PREAMBLE;
 		}
+		ap_table_unset(r->notes, PARENT_STRING);	/* cleanup */
 	    }
 	    else if (!strncasecmp("text/", rr->content_type, 5)) {
 		/*
@@ -1343,6 +1410,14 @@
     p->alt = NULL;
     p->desc = NULL;
     p->lm = -1;
+    p->isdir = 0;
+    /*
+     * It's obnoxious to have to include this in every entry, but the qsort()
+     * comparison routine only takes two arguments..  The alternative would
+     * add another function call to each invocation.  Let's use memory
+     * rather than CPU.
+     */
+    p->checkdir = ((d->opts & FOLDERS_FIRST) != 0);
     p->key = ap_toupper(keyid);
     p->ascending = (ap_toupper(direction) == D_ASCENDING);
 
@@ -1352,6 +1427,7 @@
 	if (rr->finfo.st_mode != 0) {
 	    p->lm = rr->finfo.st_mtime;
 	    if (S_ISDIR(rr->finfo.st_mode)) {
+		p->isdir = 1;
 	        if (!(p->icon = find_icon(d, rr, 1))) {
 		    p->icon = find_default_icon(d, "^^DIRECTORY^^");
 		}
@@ -1389,19 +1465,27 @@
 }
 
 static char *terminate_description(autoindex_config_rec *d, char *desc,
-				   int autoindex_opts)
+				   int autoindex_opts, int desc_width)
 {
-    int maxsize = 23;
+    int maxsize = desc_width;
     register int x;
 
-    if (autoindex_opts & SUPPRESS_LAST_MOD) {
-	maxsize += 19;
-    }
-    if (autoindex_opts & SUPPRESS_SIZE) {
-	maxsize += 7;
+    /*
+     * If there's no DescriptionWidth in effect, default to the old
+     * behaviour of adjusting the description size depending upon
+     * what else is being displayed.  Otherwise, stick with the
+     * setting.
+     */
+    if (d->desc_adjust == K_UNSET) {
+	if (autoindex_opts & SUPPRESS_LAST_MOD) {
+	    maxsize += 19;
+	}
+	if (autoindex_opts & SUPPRESS_SIZE) {
+	    maxsize += 7;
+	}
     }
 
-    for (x = 0; desc[x] && (maxsize > 0 || desc[x]=='<'); x++) {
+    for (x = 0; desc[x] && ((maxsize > 0) || (desc[x]=='<')); x++) {
 	if (desc[x] == '<') {
 	    while (desc[x] != '>') {
 		if (!desc[x]) {
@@ -1467,6 +1551,7 @@
     int static_columns = (autoindex_opts & SUPPRESS_COLSORT);
     pool *scratch = ap_make_sub_pool(r->pool);
     int name_width;
+    int desc_width;
     char *name_scratch;
     char *pad_scratch;
 
@@ -1479,6 +1564,17 @@
 	name = "/";
     }
 
+    desc_width = d->desc_width;
+    if (d->desc_adjust == K_ADJUST) {
+	for (x = 0; x < n; x++) {
+	    if (ar[x]->desc != NULL) {
+		int t = strlen(ar[x]->desc);
+		if (t > desc_width) {
+		    desc_width = t;
+		}
+	    }
+	}
+    }
     name_width = d->name_width;
     if (d->name_adjust == K_ADJUST) {
 	for (x = 0; x < n; x++) {
@@ -1613,7 +1709,8 @@
 	    if (!(autoindex_opts & SUPPRESS_DESC)) {
 		if (ar[x]->desc) {
 		    ap_rputs(terminate_description(d, ar[x]->desc,
-						   autoindex_opts), r);
+						   autoindex_opts,
+						   desc_width), r);
 		}
 	    }
 	}
@@ -1653,6 +1750,15 @@
         return 1;
     }
     /*
+     * Now see if one's a directory and one isn't, AND we're listing
+     * directories first.
+     */
+    if ((*e1)->checkdir) {
+	if ((*e1)->isdir != (*e2)->isdir) {
+	    return (*e1)->isdir ? -1 : 1;
+	}
+    }
+    /*
      * All of our comparisons will be of the c1 entry against the c2 one,
      * so assign them appropriately to take care of the ordering.
      */
@@ -1716,9 +1822,18 @@
     }
 
     r->content_type = "text/html";
-
+    if (autoindex_opts & TRACK_MODIFIED) {
+	ap_update_mtime(r, r->finfo.st_mtime);
+	ap_set_last_modified(r);
+	ap_set_etag(r);
+    }
     ap_send_http_header(r);
 
+#ifdef CHARSET_EBCDIC
+    /* Server-generated response, converted */
+    ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, r->ebcdic.conv_out = 1);
+#endif
+
     if (r->header_only) {
 	ap_pclosedir(r->pool, d);
 	return 0;
@@ -1734,7 +1849,7 @@
     }
 
     emit_head(r, find_header(autoindex_conf, r), autoindex_conf,
-	      autoindex_opts, title_name);
+	      autoindex_opts & SUPPRESS_PREAMBLE, title_name);
 
     /*
      * Figure out what sort of indexing (if any) we're supposed to use.
diff -u apache-1.3.22/debian/init apache-1.3.22/debian/init
--- apache-1.3.22/debian/init
+++ apache-1.3.22/debian/init
@@ -28,36 +28,41 @@
 
 case "$1" in
   start)
-    echo "Starting web server: $NAME."
-    $APACHECTL start
+    echo -n "Starting web server: $NAME"
+    result=$($APACHECTL start 2>&1)
     ;;
 
   stop)
-    echo "Stopping web server: $NAME."
-    $APACHECTL stop
+    echo -n "Stopping web server: $NAME"
+    result=$($APACHECTL stop 2>&1)
     ;;
 
   reload)
-    echo "Reloading $NAME configuration."
-    $APACHECTL graceful
+    echo -n "Reloading $NAME configuration"
+    result=$($APACHECTL graceful 2>&1)
     ;;
 
   reload-modules)
-    echo "Reloading $NAME modules."
-    if [ -f /var/run/apache.pid ]
-    then
-        $APACHECTL stop
-        sleep 4
+    echo -n "Reloading $NAME modules"
+    if [ -f $PIDFILE ]; then
+        result=$($APACHECTL stop 2>&1)
+	if [ $? != 0 ]; then echo; echo $result; fi
+	t=30
+	while [ -f $PIDFILE -a $((t--)) -gt 0 ]; do
+	    sleep 1
+	done
     fi
-    $APACHECTL start
+    result=$($APACHECTL start 2>&1)
     ;;
 
   restart)
     $0 reload-modules
+    exit $?
     ;;
 
   force-reload)
     $0 reload-modules
+    exit $?
     ;;
 
   *)
@@ -66,5 +71,11 @@
     ;;
 esac
 
-exit 0
-
+if [ $? == 0 ]; then
+	echo .
+	exit 0
+else
+	echo
+	echo $result
+	exit 1
+fi
diff -u apache-1.3.22/debian/control apache-1.3.22/debian/control
--- apache-1.3.22/debian/control
+++ apache-1.3.22/debian/control
@@ -7,7 +7,7 @@
 
 Package: apache
 Architecture: any
-Depends: ${shlibs:Depends}, mime-support, apache-common (>= 1.3.22), apache-common (<< 1.3.23), perl5 | perl
+Depends: ${shlibs:Depends}, mime-support, apache-common (>= 1.3.22), apache-common (<< 1.3.23), perl5 | perl, logrotate
 Suggests: apache-doc
 Conflicts: apache-modules, libapache-mod-perl (<= 1.17-1), jserv (<= 1.1-3)
 Replaces: apache-modules
diff -u apache-1.3.22/debian/rules apache-1.3.22/debian/rules
--- apache-1.3.22/debian/rules
+++ apache-1.3.22/debian/rules
@@ -18,8 +18,9 @@
 		--without-confadjust --without-execstrip \
 		--enable-shared=max --enable-rule=SHARED_CHAIN \
 		--enable-module=most --enable-module=status \
-		--enable-module=log_referer --enable-module=log_agent \
-		--enable-module=auth_db $(EXTRA_CONFARGS) \
+		--enable-module=auth_digest --enable-module=log_referer \
+		--enable-module=log_agent --enable-module=auth_db \
+		$(EXTRA_CONFARGS) \
 		--activate-module=src/modules/extra/mod_macro.c
 
 # CAVEAT COMPILOR
@@ -159,7 +160,7 @@
 	rm -f debian/apaci debian/buildinfo.Debian
 	rm -f debian/{*.gif,*.jpg,*.gz,local-apxs,apxs} o debian/o
 	rm -rf debian/debian $(IN_TARGETS) contrib/*/*o
-	chmod +x debian/{*post*,*preinst*,*prerm*,cron.daily,modchk}
+	chmod +x debian/{*post*,*preinst*,*prerm*,modchk}
 	chmod +x debian/{ubersed,apacheconfig,sys-build.mk,scripts/*.*}
 	$(MAKE) -f debian/sys-build.mk source.clean
 	rm -rf debian.diff debian/stampdir
@@ -181,6 +182,9 @@
 		debian/apacheconfig debian/tmp/usr/sbin
 	cp -a debian/apacheconfig.8 debian/tmp/$(man)/man8
 
+	mkdir -p debian/tmp/etc/logrotate.d
+	cp -a debian/logrotate debian/tmp/etc/logrotate.d/apache
+
 	chmod +x debian/ubersed
 	debian/ubersed < $(B)/src/support/apachectl \
 		>>  debian/tmp/usr/sbin/apachectl
@@ -192,21 +196,25 @@
 
 	@echo -e "\n--- install: apache-common ---\n"
 
-	mkdir -p debian/apache-common/{$(lib),usr/share/apache/icons}
+	mkdir -p debian/apache-common/{$(lib),usr/share/apache/icons/small}
 	mkdir -p debian/apache-common/usr/{bin,sbin}
 	cp -a info/* $$(find $(B) contrib/ -maxdepth 1 -name "*.so") \
 		debian/apache-common/$(lib)
-	cp -a $(B)/icons/*.gif debian/*.gif debian/*.jpg debian/debian \
+	cp -a $(B)/icons/*.{gif,png} debian/*.gif debian/*.jpg debian/debian \
 		debian/apache-common/usr/share/apache/icons
+	cp -a $(B)/icons/small/*.{gif,png} \
+		debian/apache-common/usr/share/apache/icons/small
 	mkdir -p debian/apache-common/$(doc)-common
 	cp -a $(B)/icons/README \
 		debian/apache-common/$(doc)-common/README.icons
+	cp -a $(B)/icons/small/README.txt \
+		debian/apache-common/$(doc)-common/README.small.icons
 	cp -a $(B)/src/support/suexec.{c,h} \
 		$(B)/src/include/ap_config.h \
 		debian/apache-common/$(doc)-common/
 	mkdir -p debian/apache-common/$(man)/man{1,8}
 
-	install $(B)/src/support/suexec \
+	install -m 4755 $(B)/src/support/suexec \
 		debian/apache-common/usr/lib/apache/suexec
 	install $(B)/src/support/{logresolve,rotatelogs,ab} \
 		debian/apache-common/usr/sbin
@@ -290,7 +298,7 @@
 	dh_installdocs -i
 	dh_installexamples -i
 	dh_installmenu -i
-	dh_installcron -i
+#	dh_installcron -i
 	dh_installchangelogs -i $(B)/src/CHANGES
 	dh_link -i
 	dh_compress -i
@@ -309,7 +317,7 @@
 	dh_installexamples -a
 	dh_installmenu -a
 	dh_installinit -a
-	dh_installcron -a
+#	dh_installcron -a
 	dh_installchangelogs -a $(B)/src/CHANGES
 	dh_strip -a --exclude=dbg
 	dh_link -a
diff -u apache-1.3.22/debian/apaci.append apache-1.3.22/debian/apaci.append
--- apache-1.3.22/debian/apaci.append
+++ apache-1.3.22/debian/apaci.append
@@ -4,6 +4,6 @@
 echo '-DDEFAULT_USER="#65534"'
 echo '-DDEFAULT_GROUP="#65534"'
 ARCH=$(uname | sed -e s/GNU/Hurd/)
-echo "-DSERVER_SUBVERSION=\"Debian-GNU/$ARCH\""
+echo '-DSERVER_SUBVERSION="Debian\x20GNU/'$ARCH'"'
 echo '-DLOG_EXEC="/var/log/apache/cgi.log"'
 echo '-O2 -g3 -DEAPI'
diff -u apache-1.3.22/debian/conffiles apache-1.3.22/debian/conffiles
--- apache-1.3.22/debian/conffiles
+++ apache-1.3.22/debian/conffiles
@@ -1,2 +1,2 @@
 /etc/init.d/apache
-/etc/cron.daily/apache
+/etc/logrotate.d/apache
diff -u apache-1.3.22/debian/scripts/vars apache-1.3.22/debian/scripts/vars
--- apache-1.3.22/debian/scripts/vars
+++ apache-1.3.22/debian/scripts/vars
@@ -22,6 +22,6 @@
 # Whether to die if the source cleaning fails.
 CLEAN_IGNORE=yes
 # The clean target to run.  Defaults to clean.
-CLEAN_TARGET=
+CLEAN_TARGET=distclean
 # Files to exclude from the diff.
-DIFF_EXCLUDE="Makefile.in configure *~ *.orig"
+DIFF_EXCLUDE="Makefile.in configure *~ *.orig ap_ctx.[ch] ap_hook.[ch] ap_mm.[ch] os-inline.c os.h"
diff -u apache-1.3.22/debian/changelog apache-1.3.22/debian/changelog
--- apache-1.3.22/debian/changelog
+++ apache-1.3.22/debian/changelog
@@ -1,3 +1,36 @@
+apache (1.3.22-4) unstable; urgency=low
+
+  * The "This sort of thing has cropped up before and it has always
+    been due to human error." release.
+  * Remove suidregister calls from apache-common postinst & postrm.
+    Distribute suexec as mode 4755 instead.  Closes: #84886, #119201.
+  * Integrate new mod_autoindex features from upstream.  Patch courtesy of
+    Kestutis Kupciunas <kkupciunas@alna.lt>.  Closes: #100677 #116221
+    #118518 #119711
+  * Redo init.d script based on work from John Rowland Lenton
+    <jlenton@yahoo.com> and Grant Bowman <grantbow@svpal.org>.  Now traps
+    the output from apachectl and only prints it on error.  Also waits
+    up to 30 seconds for apache to stop on a restart instead of a fixed
+    4 seconds.  Closes: #63541, #78041, #79342, #83820, #110456, #121513
+  * Change capitalisation of Order, Deny and Allow in 210mod_access.info
+    to match that in httpd.conf.  Closes: #121104, #102799
+  * Actually make SUBVERSION `Debian GNU/Linux' instead of
+    `Debian-GNU/Linux'.  Make Martin Michlmayr happy.
+  * Switch to using logrotate instead of custom apache cronjob.  Insert
+    chunk of code from Adam Heath <adam@doogie.org> in postinst to
+    check for logfiles outside /var/log/apache and echo a warning.
+    Closes: #109535, #120195, #123193, #44524, #67255, #90033, #106951,
+    #110409, #114976, #119351
+  * Add patches from Adam Heath <adam@doogie.org> to use the build system
+    better and fix a bug in apachebench.  Closes: #64317
+  * Enable mod_auth_digest.  Closes: #108752
+  * Make apache init script exit 1 on failure.  Closes: #75452
+  * Add icons/small to debian package.  Also add .png versions of .gif files.
+    Closes: #123596
+  * Add a call to /etc/init.d/apache restart in postinst.
+
+ -- Matthew Wilcox <willy@debian.org>  Fri, 14 Dec 2001 11:30:48 -0700
+
 apache (1.3.22-3) unstable; urgency=low
 
   * New maintainer.
diff -u apache-1.3.22/debian/apache-common.postrm apache-1.3.22/debian/apache-common.postrm
--- apache-1.3.22/debian/apache-common.postrm
+++ apache-1.3.22/debian/apache-common.postrm
@@ -3,8 +3,3 @@
 then
     exit 0
 fi
-if [ -e /etc/suid.conf -a -x /usr/sbin/suidunregister ]
-then
-    suidunregister -s apache-common /usr/bin/htpasswd
-    suidunregister -s apache-common /usr/lib/apache/suexec
-fi
diff -u apache-1.3.22/debian/apache-common.postinst apache-1.3.22/debian/apache-common.postinst
--- apache-1.3.22/debian/apache-common.postinst
+++ apache-1.3.22/debian/apache-common.postinst
@@ -3,13 +3,5 @@
 then
     exit 0
 fi
-if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]
-then
-    suidregister -s apache-common /usr/bin/htpasswd root root 755
-    suidregister -s apache-common /usr/lib/apache/suexec root root 4755
-else
-    chown root.root /usr/lib/apache/suexec
-    chmod 4755 /usr/lib/apache/suexec
-fi
 
 #DEBHELPER#
diff -u apache-1.3.22/debian/postinst apache-1.3.22/debian/postinst
--- apache-1.3.22/debian/postinst
+++ apache-1.3.22/debian/postinst
@@ -27,6 +27,13 @@
     exit 0
 fi
 
+if [ "$2" != "" ]
+then
+    CONFFLAGS="--update"
+else
+    CONFFLAGS="--fullauto"
+fi
+
 # adduser stuffs moved from preinst
 if [ -e /usr/sbin/adduser ]
 then
@@ -105,27 +112,30 @@
 
 update-rc.d apache defaults 91 20 > /dev/null
 
+NEED_ECHO=0
+
 if [ -d /etc/httpd ]
 then
     echo "Directory /etc/httpd is way obsolete, and should be removed."
+    NEED_ECHO=1
 fi
 
 if [ -d /usr/lib/httpd/cgi-bin ]
 then
     echo "Copying CGI files to /usr/lib/cgi-bin."
     cp -ia /usr/lib/httpd/cgi-bin/* /usr/lib/cgi-bin || true
+    NEED_ECHO=1
 fi
 
 if [ -d /usr/lib/httpd ]
 then
     echo "Directory /usr/lib/httpd is now obsolete, and should be removed."
     echo "(Icons are in /usr/share/apache/icons, CGI in /usr/lib/cgi-bin.)"
-    echo
+    NEED_ECHO=1
 fi
 
 if  [ -d /var/log/apache-httpd ]
 then
-    echo
     echo 'Copying log files to their new location...'
     (cd /var/log/apache-httpd; tar cf - .) |
 	(cd /var/log/apache; tar xpf -) && rm -rf /var/log/apache-httpd
@@ -139,18 +149,40 @@
 	else
 	    mv -f $f "`echo $f | sed 's,_log,.log,'`";
 	fi; done)
+    NEED_ECHO=1
 fi
 
-if  [ -d /etc/httpd -o /var/log/apache-httpd -o -d /usr/lib/httpd ]
-then
-    echo
+# Check for log files.
+set -- /etc/apache/*.conf
+while [ $# -gt 0 ]; do
+    CONFS=${CONFS:+$CONFS }$1
+    set -- "$@" $(awk '$1 ~ /^\s*[Ii]nclude$/ && $2 ~ /^\// {print $2}' $1 | sort -u )
+    shift
+done
+LOGS=$(awk '$1 ~ /^\s*[A-Za-z]*Log$/ {print $2}' $CONFS | sort -u)
+BAD_LOG=0
+for i in $LOGS; do
+    # relative log, always bad
+    if [ ${i:0:1} != / ]; then
+	BAD_LOG=1
+	break
+    fi
+    i=${i##/var/log/apache/}
+    if [ $i != ${i//\//} ]; then
+	BAD_LOG=1
+	break
+    fi
+done
+if [ $BAD_LOG = 1 ]; then
+    echo Apache has switched to using logrotate.  However, some of your logs
+    echo are stored outside the /var/log/apache directory, so you should edit
+    echo /etc/logrotate.d/apache to have them automatically rotated.
+    NEED_ECHO=1
 fi
 
-if [ "$2" != "" ]
+if [ $NEED_ECHO = 1 ]
 then
-    CONFFLAGS="--update"
-else
-    CONFFLAGS="--fullauto"
+    echo
 fi
 
 if grep assert-perl /usr/sbin/apacheconfig > /dev/null 2>&1 \
@@ -181,6 +213,8 @@
                 ln -sf ../share/doc/apache /usr/doc/apache
         fi
 fi
+
+/etc/init.d/apache restart
 
 exit 0
 
diff -u apache-1.3.22/debian/httpd.conf apache-1.3.22/debian/httpd.conf
--- apache-1.3.22/debian/httpd.conf
+++ apache-1.3.22/debian/httpd.conf
@@ -468,6 +468,11 @@
 #
 HostnameLookups Off
 
+# Note that Log files are now rotated by logrotate, not by apache itself.
+# This means that apache no longer attempts to magically determine
+# where your log files are kept; you have to fill out stanzas in
+# /etc/logrotate.d/apache yourself.
+
 #
 # ErrorLog: The location of the error log file.
 # If you do not specify an ErrorLog directive within a <VirtualHost>
only in patch2:
--- apache-1.3.22.orig/debian/patches/ab_overzealous_connections
+++ apache-1.3.22/debian/patches/ab_overzealous_connections
@@ -0,0 +1,13 @@
+diff -ruN apache_1.3.9.orig/src/support/ab.c apache_1.3.9/src/support/ab.c
+--- apache_1.3.9.orig/src/support/ab.c	Thu May 18 02:43:06 2000
++++ apache_1.3.9/src/support/ab.c	Thu May 18 02:36:24 2000
+@@ -602,7 +602,8 @@
+     FD_CLR(c->fd, &writebits);
+ 
+     /* connect again */
+-    start_connect(c);
++    if(done < requests)
++	start_connect(c);
+     return;
+ }
+ 
only in patch2:
--- apache-1.3.22.orig/debian/logrotate
+++ apache-1.3.22/debian/logrotate
@@ -0,0 +1,12 @@
+/var/log/apache/*.log {
+	weekly
+	missingok
+	rotate 52
+	compress
+	notifempty
+	create 640 root adm
+	sharedscripts
+	postrotate
+		/etc/init.d/apache reload > /dev/null
+	endscript
+}

-- 
Revolutions do not require corporate support.



Reply to: