Clean system group IDs
[hvlinux.git] / stage5 / pkg / apache
index ee38f22..4e8c1dc 100644 (file)
@@ -32,9 +32,9 @@ hvconfig_pre()
 </Layout>
 EOF
 
-    groupadd -f ${APACHE_USER}
-    hv_useradd -c WebServer -d /dev/null -g ${APACHE_USER} -s /bin/false \
-        ${APACHE_USER}
+    groupadd --system -f ${HTTPD_USER}
+    hv_useradd --system -c WebServer -d /dev/null -g ${HTTPD_USER} \
+        -s /bin/false ${HTTPD_USER}
 
     CONFIGURE_OPTS=" \
         --enable-layout=FHS \
@@ -64,8 +64,8 @@ hvbuild_post()
 
     # Modifying the configuration file to run the server as a dedicated user:
     sed -i \
-        -e "s!^\(User\).*!\1 ${APACHE_USER}!g" \
-        -e "s!^\(Group\).*!\1 ${APACHE_USER}!g" \
+        -e "s!^\(User\).*!\1 ${HTTPD_USER}!g" \
+        -e "s!^\(Group\).*!\1 ${HTTPD_USER}!g" \
         ${CONFDIR}/httpd.conf
 
     # SSL Certificates generation script
@@ -134,11 +134,13 @@ EOF
     sed -i -e "s!^ServerAdmin .*!ServerAdmin webmaster@${DOMAIN}!" ${CONFDIR}/ssl/ssl.conf
     sed -i -e "s!${CONFDIR}!${CONFDIR}/ssl!" ${CONFDIR}/ssl/ssl.conf
 
-    chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/www
+    chown -v -R ${HTTPD_USER}:${HTTPD_USER} /srv/www
 
     # Bootscript
     install -v -m740 ${SCRDIR}/bootscripts/apache /etc/rc.d/init.d
 
     # script-name start stop
-    bootscript_add_rc3 apache 70 20
+    if [ "x${DEFAULT_WEB_SERVER}" == "xhttpd" ]; then
+        bootscript_add_rc3 apache 70 20
+    fi
 }