dirkx 99/04/05 13:53:08
Modified: . configure Makefile.tmpl src CHANGES Log: Changes to configuration to guess the userid and groupid apache runs as. And to chown/chgrp the proxycachedir during an install. Submitted by: dirkx Reviewed by: rse Revision Changes Path 1.80 +17 -6 apache-1.3/configure Index: configure =================================================================== RCS file: /x3/home/cvs/apache-1.3/configure,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- configure 1999/04/02 10:38:03 1.79 +++ configure 1999/04/05 20:53:05 1.80 @@ -1004,19 +1004,29 @@ ## ## determine special configuration parameters +## +## The checks via /etc/passwd and /etc/group will obviously fail +## on platforms using NIS. But then you propably do not want a +## UID/GID as production oriented as a web server in NIS anyway. ## +conf_user="nobody" conf_group="#-1" conf_port="80" conf_serveradmin="[EMAIL PROTECTED]" conf_servername="new.host.name" if [ "x$confadjust" = "x1" ]; then - if [ ".`egrep '^nobody:' /etc/group`" != . ]; then - conf_group="nobody" - else - if [ ".`egrep '^nogroup:' /etc/group`" != . ]; then - conf_group="nogroup" + for uid in nobody www daemon demon http httpd; do + if [ "x`egrep \^${uid}: /etc/passwd`" != "x" ]; then + conf_user="$uid" + break fi - fi + done + for gid in nobody nogroup www daemon demon http httpd; do + if [ "x`egrep \^${gid}: /etc/group`" != "x" ]; then + conf_group="$gid" + break + fi + done if [ ".`id | grep root`" = . ]; then conf_port="8080" fi @@ -1122,6 +1132,7 @@ -e "[EMAIL PROTECTED]@%$suexec_uidmin%g" \ -e "[EMAIL PROTECTED]@%$suexec_gidmin%g" \ -e "[EMAIL PROTECTED]@%$suexec_safepath%g" \ +-e "[EMAIL PROTECTED]@%$conf_user%g" \ -e "[EMAIL PROTECTED]@%$conf_group%g" \ -e "[EMAIL PROTECTED]@%$conf_port%g" \ -e "[EMAIL PROTECTED]@%$conf_serveradmin%g" \ 1.70 +4 -0 apache-1.3/Makefile.tmpl Index: Makefile.tmpl =================================================================== RCS file: /x3/home/cvs/apache-1.3/Makefile.tmpl,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- Makefile.tmpl 1999/03/29 11:40:18 1.69 +++ Makefile.tmpl 1999/04/05 20:53:05 1.70 @@ -134,6 +134,7 @@ suexec_safepath = @suexec_safepath@ # some substituted configuration parameters +conf_user = @conf_user@ conf_group = @conf_group@ conf_port = @conf_port@ conf_serveradmin = @conf_serveradmin@ @@ -256,6 +257,8 @@ $(MKDIR) $(root)$(runtimedir) $(MKDIR) $(root)$(logfiledir) $(MKDIR) $(root)$(proxycachedir) + chown $(conf_user) $(root)$(proxycachedir) + chgrp $(conf_group) $(root)$(proxycachedir) @echo "<=== [mktree]" # install the server program and optionally corresponding @@ -442,6 +445,7 @@ -e "s;logs/agent_log;$(logfiledir)/$${target_prefix}agent_log;" \ -e 's;conf/magic;$(sysconfdir)/magic;' \ -e 's;conf/mime\.types;$(sysconfdir)/mime.types;' \ + -e 's;User nobody;User $(conf_user);' \ -e 's;Group #-1;Group $(conf_group);' \ -e 's;Port 80;Port $(conf_port);' \ -e 's;ServerAdmin [EMAIL PROTECTED];ServerAdmin $(conf_serveradmin);' \ 1.1297 +14 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /x3/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1296 retrieving revision 1.1297 diff -u -r1.1296 -r1.1297 --- CHANGES 1999/04/02 10:37:59 1.1296 +++ CHANGES 1999/04/05 20:53:07 1.1297 @@ -1,5 +1,19 @@ Changes with Apache 1.3.7 + *) Be more smart in APACI's configure script when determining the UID/GID + for User/Group directives and use the determined UID/GID to initialize + the permissions on the proxycachedir. + [Dirk-Willem van Gulik, Ralf S. Engelschall] + + *) Changed the forking-prior-to-cleanup in the proxy module to first + check wether it actually needs to collect garbage. This reduces + the number of fork()s from one/request to just the odd one an hour. + [Dirk-Willem van Gulik] + + *) Added proxy, auth and header support to src/support/ab.c. Added a + README file to src/support/ + [Dirk-Willem van Gulik] + *) Don't hard-code the path to AWK in --shadow bootstrapping Makefile. [Ralf S. Engelschall] PR#4050