Debian 10 Is Running A New Enough Apache2 Version By Default

This commit is contained in:
earnolmartin 2019-10-18 12:07:47 -06:00
parent 6bd7a12070
commit ee71315ceb
2 changed files with 26 additions and 42 deletions

View file

@ -161,32 +161,22 @@ function apacheUseFPM(){
a2dismod php7.2 a2dismod php7.2
# We need a newer version of Apache for this to work properly! # We need a newer version of Apache for this to work properly!
add-apt-repository -y ppa:ondrej/apache2 if [[ "$distro" == "ubuntu" && "$yrelease" -eq "16" && "$mrelease" == "04" ]] || [[ "$distro" == "debian" && "$yrelease" -eq "9" ]]; then
aptget_Update add-apt-repository -y ppa:ondrej/apache2
aptget_Update
# Harder to use PPAs from Ubuntu on Debian, but still possible :)
if [ "$distro" == "debian" ] && [ "$yrelease" -eq "8" ]; then
sed -i "s/jessie/trusty/g" "/etc/apt/sources.list.d/ondrej-apache2-jessie.list"
sed -i "s/jessie/trusty/g" "/etc/apt/sources.list.d/ondrej-apache2-jessie.list.save"
fi
if [ "$distro" == "debian" ] && [ "$yrelease" -eq "9" ]; then
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list"
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save"
sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list" # Harder to use PPAs from Ubuntu on Debian, but still possible :)
sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save" if [ "$distro" == "debian" ] && [ "$yrelease" -eq "9" ]; then
fi sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list"
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save"
if [ "$distro" == "debian" ] && [ "$yrelease" -eq "10" ]; then
sed -i "s/cosmic/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list" sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list"
sed -i "s/cosmic/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save" sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save"
fi
sed -i "s/eoan/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list" aptget_Update
sed -i "s/eoan/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save" apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" apache2
fi fi
aptget_Update
apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" apache2
} }
function changeNginxUser(){ function changeNginxUser(){

View file

@ -864,28 +864,22 @@ function apacheUseFPM(){
a2dismod php7.2 a2dismod php7.2
# We need a newer version of Apache for this to work properly! # We need a newer version of Apache for this to work properly!
add-apt-repository -y ppa:ondrej/apache2 if [[ "$distro" == "ubuntu" && "$yrelease" -eq "16" && "$mrelease" == "04" ]] || [[ "$distro" == "debian" && "$yrelease" -eq "9" ]]; then
aptget_Update add-apt-repository -y ppa:ondrej/apache2
aptget_Update
# Harder to use PPAs from Ubuntu on Debian, but still possible :)
if [ "$distro" == "debian" ] && [ "$yrelease" -eq "9" ]; then
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list"
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save"
sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list" # Harder to use PPAs from Ubuntu on Debian, but still possible :)
sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save" if [ "$distro" == "debian" ] && [ "$yrelease" -eq "9" ]; then
fi sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list"
sed -i "s/cosmic/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save"
if [ "$distro" == "debian" ] && [ "$yrelease" -eq "10" ]; then
sed -i "s/cosmic/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list" sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list"
sed -i "s/cosmic/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-cosmic.list.save" sed -i "s/eoan/xenial/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save"
fi
sed -i "s/eoan/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list" aptget_Update
sed -i "s/eoan/bionic/g" "/etc/apt/sources.list.d/ondrej-ubuntu-apache2-eoan.list.save" apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" apache2
fi fi
aptget_Update
apt-get install -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" apache2
} }
function changeNginxUser(){ function changeNginxUser(){