httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject [PATCH] Substitute Some More Configuration Parameters (for 1.3.1-dev)
Date Mon, 04 May 1998 16:04:42 GMT
[for 1.3.1-dev]

Substitute Some More Configuration Parameters
=============================================

This patch lets APACI's configure script determine more configuration
parameters (Group, Port, ServerAdmin, ServerName) via some intelligent tests
to remove some of the classical hurdles for new users when setting up Apache.

Actually it currently substs

   Group #-1                         Group nobody                   
     :                                 :                         
   Port 80                           Port 8080
     :                          ==>    :                         
   ServerAdmin you@your.address      ServerAdmin rse@en5.engelschall.com
     :                                 :                         
   #ServerName new.server.com        #ServerName en5.engelschall.com

when the non-root "rse" user installs Apache under Solaris. Why?  Because #-1
causes problems under Solaris, Port 80 is not allowed for non-root users and
ServerAdmin and ServerName can be set to at least approximate the real things.

Greetings,
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: src/CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.815
diff -u -r1.815 CHANGES
--- CHANGES	1998/05/04 06:58:02	1.815
+++ CHANGES	1998/05/04 15:18:03
@@ -1,3 +1,15 @@
+Changes with Apache 1.3.1
+
+    : 
+
+  *) Let APACI's configure script determine some configuration parameters
+     (Group, Port, ServerAdmin, ServerName) via some intelligent tests to
+     remove some of the classical hurdles for new users when setting up
+     Apache.
+     [Ralf S. Engelschall]
+
+    :
+
 Changes with Apache 1.3b7
 
   *) Ronald Tschalaer's Accept-Encoding patch - preserve the "x-" in
Index: Makefile.tmpl
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/Makefile.tmpl,v
retrieving revision 1.31
diff -u -r1.31 Makefile.tmpl
--- Makefile.tmpl	1998/05/04 15:29:25	1.31
+++ Makefile.tmpl	1998/05/04 15:55:02
@@ -115,6 +115,12 @@
 suexec_caller   = @suexec_caller@
 suexec_userdir  = @suexec_userdir@
 
+#   some substituted configuration parameters
+conf_group       = @conf_group@
+conf_port        = @conf_port@
+conf_serveradmin = @conf_serveradmin@
+conf_servername  = @conf_servername@
+
 #   usage of src/support stuff
 build-support     = @build_support@
 install-support   = @install_support@
@@ -376,6 +382,10 @@
 			-e 's;logs/referer_log;$(logfiledir)/referer_log;' \
 			-e 's;logs/agent_log;$(logfiledir)/agent_log;' \
 			-e 's;conf/magic;$(sysconfdir)/magic;' \
+			-e 's;Group #-1;Group $(conf_group);' \
+			-e 's;Port 80;Port $(conf_port);' \
+			-e 's;ServerAdmin you@your.address;ServerAdmin $(conf_serveradmin);' \
+			-e 's;ServerName new.host.name;ServerName $(conf_servername);' \
         	> $(TOP)/$(SRC)/.apaci.install.tmp && \
 		echo "$(INSTALL_DATA) $(TOP)/conf/$${conf}-dist[*] $(root)$(sysconfdir)/$${conf}.default";
\
 		$(INSTALL_DATA) $(TOP)/$(SRC)/.apaci.install.tmp $(root)$(sysconfdir)/$${conf}.default;
\
Index: configure
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/configure,v
retrieving revision 1.22
diff -u -r1.22 configure
--- configure	1998/04/27 13:00:59	1.22
+++ configure	1998/05/04 15:15:22
@@ -694,6 +694,54 @@
 fi
 
 ##
+##  determine special configuration parameters
+##
+conf_group="#-1"
+if [ ".`egrep ^nobody: /etc/group`" != . ]; then
+    conf_group="nobody"
+fi
+conf_port="80"
+if [ ".`id | grep root`" = . ]; then
+    conf_port="8080"
+fi
+username="$LOGNAME"
+if [ ".$username" = . ]; then
+    username="$USER"
+    if [ ".$username" = . ]; then
+        username="`whoami 2>/dev/null | sed -e 's/\n$//'`"
+        if [ ".$username" = . ]; then
+            username="`who am i 2>/dev/null | cut '-d ' -f1`"
+            if [ ".$username" = . ]; then
+                username="unknown"
+            fi
+        fi
+    fi
+fi
+hostname="`uname -n | sed -e 's/\n$//'`"
+if [ ".$hostname" = . ]; then
+    hostname="`hostname | sed -e 's/\n$//'`"
+    if [ ".$hostname" = . ]; then
+        hostname="hostname"
+    fi
+fi
+hostname="`echo $hostname | sed -e 's/\..*//'`"
+domainname="";
+if [ -f /etc/resolv.conf ]; then
+    domainname="`egrep '^[  ]*domain' /etc/resolv.conf |\
+                 sed -e 's/.*domain//' -e 's/^[     ]*//' \
+                     -e 's/^ *//' -e 's/^   *//' \
+                     -e 's/^\.//' -e 's/^/./'`"
+    if [ ".$domainname" = . ]; then
+        domainname="`egrep '^[ 	]*search' /etc/resolv.conf |\
+		             sed -e 's/.*search//' -e 's/^[ 	]*//' \
+					     -e 's/^ *//' -e 's/^	*//' \
+						 -e 's/ .*//' -e 's/^\.//' -e 's/^/./'`"
+    fi
+fi
+conf_serveradmin="$username@$hostname$domainname"
+conf_servername="$hostname$domainname"
+
+##
 ##  determine prefix-relative paths for directories
 ##  because Apache supports them for the -d and -f 
 ##  options, the LoadModule directive, etc.
@@ -773,6 +821,10 @@
 -e "s%@suexec@%$suexec%g" \
 -e "s%@suexec_caller@%$suexec_caller%g" \
 -e "s%@suexec_userdir@%$suexec_userdir%g" \
+-e "s%@conf_group@%$conf_group%g" \
+-e "s%@conf_port@%$conf_port%g" \
+-e "s%@conf_serveradmin@%$conf_serveradmin%g" \
+-e "s%@conf_servername@%$conf_servername%g" \
 -e "s%@build_support@%$build_support%g" \
 -e "s%@install_support@%$install_support%g" \
 -e "s%@clean_support@%$clean_support%g" \

Mime
View raw message