forked from pool/apache2
- modified patches % apache2-mod_proxy_uwsgi-fix-crash.patch (refreshed) - modified sources % apache2-loadmodule.conf % apache2-manual.conf % apache2-script-helpers % apache2@.service % sysconfig.apache2 - deleted patches - deprecated-scripts-arch.patch (not needed) - httpd-2.0.54-envvars.dif (not needed) - httpd-2.1.3alpha-layout.dif (renamed to apache2-system-dirs-layout.patch) - httpd-2.2.0-apxs-a2enmod.dif (not needed) - httpd-2.4.9-bnc690734.patch (renamed to apache2-LimitRequestFieldSize-limits-headers.patch) - httpd-2.4.x-fate317766-config-control-two-protocol-options.diff (renamed to apache2-HttpContentLengthHeadZero-HttpExpectStrict.patch) - httpd-2.x.x-logresolve.patch (renamed to apache2-logresolve-tmp-security.patch) - httpd-apachectl.patch (renamed to apache2-apachectl.patch) - httpd-implicit-pointer-decl.patch (not needed) - httpd-visibility.patch (not needed) - deleted sources - SUSE-NOTICE (outdated) - a2enflag (renamed to apache2-a2enflag) - a2enmod (renamed to apache2-a2enmod) - apache-22-24-upgrade (outdated) OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=624
100 lines
2.3 KiB
Bash
100 lines
2.3 KiB
Bash
#!/bin/bash
|
|
|
|
HTTPD_SBIN_BASE="/usr/sbin/httpd"
|
|
|
|
#
|
|
# loads sysconfig variables into environment
|
|
#
|
|
# return value in: APACHE_*
|
|
#
|
|
function load_sysconfig
|
|
{
|
|
[ -n "$sysconfig_loaded" ] && return
|
|
[ ! -f "$HTTPD_SYSCONFIG_FILE" ] && return
|
|
|
|
. $HTTPD_SYSCONFIG_FILE
|
|
|
|
export ${!APACHE_*} sysconfig_loaded=true
|
|
}
|
|
|
|
#
|
|
# finds prefered multiprocessing module
|
|
#
|
|
# return value in: HTTPD_MPM
|
|
#
|
|
|
|
function find_mpm
|
|
{
|
|
# load sysconfig variables if they weren't yet;
|
|
# this has no effect when find_mpm is not called
|
|
# from start_apache2
|
|
load_sysconfig
|
|
|
|
# try to read from sysconfig's APACHE_MPM
|
|
HTTPD_MPM="$APACHE_MPM"
|
|
# if empty, then choose the one chosen by
|
|
# update alternatives
|
|
if [ -z "$HTTPD_MPM" ]; then
|
|
HTTPD_MPM=$(readlink $(readlink /usr/sbin/httpd) | sed "s:/usr/sbin/httpd-::")
|
|
fi
|
|
|
|
# in case no
|
|
export HTTPD_MPM
|
|
}
|
|
|
|
#
|
|
# search for paths for wanted modules (declared in
|
|
# APACHE_MODULES)
|
|
#
|
|
# return value in: HTTPD_MODULE_IDS
|
|
# HTTPD_MODULE_PATHS
|
|
#
|
|
|
|
function get_module_list
|
|
{
|
|
load_sysconfig
|
|
find_mpm
|
|
|
|
for module in $APACHE_MODULES; do
|
|
# special case
|
|
# remove or add 'd' on in cgi module name
|
|
case $module in mod_cgid|cgid)
|
|
case $HTTPD_MPM in prefork) module=${module%d};; esac;;
|
|
esac
|
|
case $module in mod_cgi|cgi)
|
|
case $HTTPD_MPM in event|worker) module=${module}d;; esac;;
|
|
esac
|
|
|
|
module_id=${module#mod_}_module
|
|
|
|
# special case
|
|
case $module_id in auth_mysql_module) module_id=mysql_auth_module;; esac
|
|
|
|
unset module_path
|
|
for libdir in /usr/lib64 /usr/lib; do
|
|
for filepath in $libdir/apache2-$HTTPD_MPM/mod_$module.so \
|
|
$libdir/apache2-$HTTPD_MPM/$module.so \
|
|
$libdir/apache2/mod_$module.so \
|
|
$libdir/apache2/$module.so; do
|
|
if [ -f $filepath ]; then
|
|
module_path=$filepath
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -n "$module_path" ]; then
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -n "$module_path" ]; then
|
|
HTTPD_MODULE_IDS="$HTTPD_MODULE_IDS $module_id"
|
|
HTTPD_MODULE_PATHS="$HTTPD_MODULE_PATHS $module_path"
|
|
fi
|
|
done
|
|
|
|
export HTTPD_MODULE_IDS
|
|
export HTTPD_MODULE_PATHS
|
|
}
|
|
|