Accepting request 338023 from home:pgajdos
- start_apache2: reintroduce sysconfig.d, include it on command line (not in httpd.conf) instead of individual directives [bnc#949434] (internal), [bnc#941331] OBS-URL: https://build.opensuse.org/request/show/338023 OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=460
This commit is contained in:
parent
03bf97c804
commit
f75ecd3daa
@ -15,7 +15,7 @@ Any other instance can be activated via
|
||||
|
||||
systemctl start apache2@<instancename>
|
||||
|
||||
for example
|
||||
where <instancename> is ASCII identifier of the instance. For example
|
||||
|
||||
systemctl start apache2@myweb.org
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 12 09:00:27 UTC 2015 - pgajdos@suse.com
|
||||
|
||||
- start_apache2: reintroduce sysconfig.d, include it on
|
||||
command line (not in httpd.conf) instead of individual directives
|
||||
[bnc#949434] (internal), [bnc#941331]
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 13 13:04:00 UTC 2015 - schwab@suse.de
|
||||
|
||||
|
@ -69,6 +69,11 @@ done
|
||||
#
|
||||
httpd_conf=${APACHE_HTTPD_CONF:-/etc/apache2${instance_suffix}/httpd.conf}
|
||||
|
||||
#
|
||||
# where to write configuration depending on sysconfig variables
|
||||
#
|
||||
sysconfd_dir=$(dirname $httpd_conf)/sysconfig${instance_suffix}.d/
|
||||
|
||||
#
|
||||
# set PidFile to this file name; PidFile should not
|
||||
# be used in the configuration to change this, otherwise
|
||||
@ -80,54 +85,58 @@ unset sysconfig_setting
|
||||
#
|
||||
# involve the sysconfig variables
|
||||
#
|
||||
# APACHE_ACCESS_LOG
|
||||
mkdir -p ${sysconfd_dir} || exit 1
|
||||
for c in global.conf include.conf loadmodule.conf; do
|
||||
echo "# File generated from $SYSCONFIG_FILE, do not edit. Edit the sysconfig file instead." > ${sysconfd_dir}/$c
|
||||
done
|
||||
# APACHE_ACCESS_LOG -> global.conf
|
||||
if [ -n "$APACHE_ACCESS_LOG" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "CustomLog $APACHE_ACCESS_LOG")
|
||||
echo "CustomLog $APACHE_ACCESS_LOG" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_CONF_INCLUDE_FILES
|
||||
# APACHE_CONF_INCLUDE_FILES -> include.conf
|
||||
for file in $APACHE_CONF_INCLUDE_FILES; do
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "Include $file")
|
||||
echo "Include $file" >> include.conf
|
||||
done
|
||||
# APACHE_CONF_INCLUDE_DIRS
|
||||
# APACHE_CONF_INCLUDE_DIRS -> include.conf
|
||||
for dir in $APACHE_CONF_INCLUDE_DIRS; do
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "Include $dir")
|
||||
echo "Include $dir" >> include.conf
|
||||
done
|
||||
# APACHE_SERVERADMIN
|
||||
# APACHE_SERVERADMIN -> global.conf
|
||||
if [ -n "$APACHE_SERVERADMIN" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "ServerAdmin $APACHE_SERVERADMIN")
|
||||
echo "ServerAdmin $APACHE_SERVERADMIN" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_SERVERNAME
|
||||
# APACHE_SERVERNAME -> global.conf
|
||||
if [ -n "$APACHE_SERVERNAME" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "ServerName $APACHE_SERVERNAME")
|
||||
echo "ServerName $APACHE_SERVERNAME" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_START_TIMEOUT
|
||||
# not used nowadays
|
||||
# APACHE_SERVERSIGNATURE
|
||||
# APACHE_SERVERSIGNATURE -> global.conf
|
||||
if [ -n "$APACHE_SERVERSIGNATURE" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "ServerSignature $APACHE_SERVERSIGNATURE")
|
||||
echo "ServerSignature $APACHE_SERVERSIGNATURE" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_LOGLEVEL
|
||||
# APACHE_LOGLEVEL -> global.conf
|
||||
if [ -n "$APACHE_LOGLEVEL" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "LogLevel $APACHE_LOGLEVEL")
|
||||
echo "LogLevel $APACHE_LOGLEVEL" >> global.conf
|
||||
fi
|
||||
# APACHE_USE_CANONICAL_NAME
|
||||
# APACHE_USE_CANONICAL_NAME -> global.conf
|
||||
if [ -n "$APACHE_USE_CANONICAL_NAME" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "UseCanonicalName $APACHE_USE_CANONICAL_NAME")
|
||||
echo "UseCanonicalName $APACHE_USE_CANONICAL_NAME" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_SERVERTOKENS
|
||||
# APACHE_SERVERTOKENS -> global.conf
|
||||
if [ -n "$APACHE_SERVERTOKENS" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "ServerTokens $APACHE_SERVERTOKENS")
|
||||
echo "ServerTokens $APACHE_SERVERTOKENS" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_EXTENDED_STATUS
|
||||
# APACHE_EXTENDED_STATUS -> global.conf
|
||||
if [ -n "$APACHE_EXTENDED_STATUS" ]; then
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "ExtendedStatus $APACHE_EXTENDED_STATUS")
|
||||
echo "ExtendedStatus $APACHE_EXTENDED_STATUS" >> ${sysconfd_dir}/global.conf
|
||||
fi
|
||||
# APACHE_MODULES
|
||||
# APACHE_MODULES -> loadmodule.conf
|
||||
get_module_list
|
||||
module_ids=($HTTPD_MODULE_IDS)
|
||||
module_paths=($HTTPD_MODULE_PATHS)
|
||||
for i in "${!module_ids[@]}"; do
|
||||
sysconfig_setting=("${sysconfig_setting[@]}" "-C" "LoadModule ${module_ids[$i]} ${module_paths[$i]}")
|
||||
echo "LoadModule ${module_ids[$i]} ${module_paths[$i]}" >> ${sysconfd_dir}/loadmodule.conf
|
||||
done
|
||||
|
||||
#
|
||||
@ -142,6 +151,7 @@ HOME=/var/lib/apache2${instance_suffix}
|
||||
|
||||
exec $apache_bin -f $httpd_conf $server_flags \
|
||||
-C "PidFile $pid_file" \
|
||||
-C "Include $sysconfd_dir" \
|
||||
"${sysconfig_setting[@]}" \
|
||||
$@
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user