fix: RHEL系的apache模组启用与加载

This commit is contained in:
Akatsukiro 2024-01-18 17:40:35 +08:00
parent d8fb28c930
commit 521ec6ea0b
Signed by: Akatsukiro
GPG Key ID: 93F1D32999999999

View File

@ -122,13 +122,12 @@ install_apache() {
if [[ $systemFlag == "1" ]]; then
wget -O /usr/share/keyrings/apache2.gpg https://packages.sury.org/apache2/apt.gpg
echo "deb [signed-by=/usr/share/keyrings/apache2.gpg] https://packages.sury.org/apache2/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/apache2.list
apt update && apt install apache2 -y
elif [[ $systemFlag == "2" ]]; then
add-apt-repository ppa:ondrej/apache2
apt update && apt install apache2 -y
elif [[ $systemFlag == "3" ]]; then
dnf install httpd -y
fi
if [[ $systemFlag == "1" ]] || [[ $systemFlag == "2" ]]; then
apt update && apt install apache2 -y
a2enconf php8.1-fpm
a2enmod proxy_fcgi
a2enmod headers
@ -139,6 +138,16 @@ install_apache() {
a2enmod expires
systemctl restart apache2
systemctl restart php8.1-fpm
elif [[ $systemFlag == "3" ]]; then
dnf install httpd -y
ln -s /etc/httpd/conf.d/php8.1-fpm.conf /etc/httpd/conf.modules.d/15-php8.1-fpm.conf
modules=("proxy_fcgi" "headers" "http2" "remoteip" "ssl" "rewrite" "expires")
for module in "${modules[@]}"; do
echo "LoadModule ${module}_module modules/mod_${module}.so" > /etc/httpd/conf.modules.d/10-${module}.conf
done
systemctl restart httpd
systemctl restart php-fpm.service
fi
}
install_maraidb() {