Cleanup apache

This commit is contained in:
2020-12-09 17:26:38 +01:00
parent fe742ec534
commit 92b487345e

View File

@@ -4,21 +4,20 @@ systemctl stop $apacheService > $OUTPUT 2>&1
# Apache # # Apache #
############## ##############
#Centos if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then
if [ "$shortdist" = "el8" ]; then a2dissite 000-default > $OUTPUT 2>&1
a2dismod mpm_prefork > $OUTPUT 2>&1
a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb > $OUTPUT 2>&1
mkdir -p "$apacheConfDir"/snippets/
elif [ "$shortdist" = "el8" ]; then
echo 'IncludeOptional conf-enabled/*.conf'/etc/httpd/conf/httpd.conf echo 'IncludeOptional conf-enabled/*.conf'/etc/httpd/conf/httpd.conf
echo 'IncludeOptional sites-enabled/*.conf'/etc/httpd/conf/httpd.conf echo 'IncludeOptional sites-enabled/*.conf'/etc/httpd/conf/httpd.conf
sed -i -e '/User apache/c\User www-data' -e '/Group apache/c\Group www-data' /etc/httpd/conf/httpd.conf sed -i -e '/User apache/c\User www-data' -e '/Group apache/c\Group www-data' /etc/httpd/conf/httpd.conf
sed -i 's/^/#/g' /etc/httpd/conf.d/welcome.conf sed -i 's/^/#/g' /etc/httpd/conf.d/welcome.conf
#Creating directories #Creating directories
mkdir -p /etc/httpd/{sites-available,sites-enabled,conf-enabled,conf-available,} mkdir -p /etc/httpd/{sites-available,sites-enabled,conf-enabled,conf-available,snippets}
fi fi
a2dissite 000-default > $OUTPUT 2>&1
a2dismod mpm_prefork > $OUTPUT 2>&1
a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb > $OUTPUT 2>&1
mkdir -p "$apacheConfDir"/snippets/
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -o "$apacheConfDir"/snippets/apa-ssl.conf curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -o "$apacheConfDir"/snippets/apa-ssl.conf
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-backendredir.conf -o "$apacheConfDir"/snippets/apa-backendredir.conf curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-backendredir.conf -o "$apacheConfDir"/snippets/apa-backendredir.conf
sed -i -e 's/HOSTname/'$hostname'/' "$apacheConfDir"/snippets/apa-backendredir.conf sed -i -e 's/HOSTname/'$hostname'/' "$apacheConfDir"/snippets/apa-backendredir.conf