From 898a6af9009007e41ba87078a2676c247bd7c0d1 Mon Sep 17 00:00:00 2001 From: Conan_Doyl Date: Thu, 10 Sep 2020 19:51:15 +0200 Subject: [PATCH] added debian 8 support --- lamp-headless.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/lamp-headless.sh b/lamp-headless.sh index 6e4135f..d307135 100644 --- a/lamp-headless.sh +++ b/lamp-headless.sh @@ -98,6 +98,67 @@ install_Debian9(){ } +install_debian8() { + apt-get install --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" sudo + echo -e "\n\e[92mFixing Source list...\e[39m" + echo "deb http://deb.debian.org/debian jessie main + deb-src http://deb.debian.org/debian jessie main + + ## Major bug fix updates produced after the final release of the + ## distribution. + deb http://security.debian.org/ jessie/updates main + deb-src http://security.debian.org/ jessie/updates main + deb http://deb.debian.org/debian jessie-updates main + deb-src http://deb.debian.org/debian jessie-updates main + " > /etc/apt/sources.list + echo 'deb http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list + echo 'deb-src http://packages.dotdeb.org jessie all' >> /etc/apt/sources.list + cd /tmp + wget https://www.dotdeb.org/dotdeb.gpg + apt-key add dotdeb.gpg + + apt-get update + apt-get install --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" php7.0-common php7.0-fpm php7.0-cli php7.0-json php7.0-imap php7.0-mysql php7.0-curl php7.0-imap php7.0-intl php7.0-mcrypt php-pear php7.0-gd php7.0-zip php7.0-xml php7.0-mbstring + apt-get install --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 libapache2-mod-php7.0 mysql-server + + echo -e "\n\e[92mDownloading PHPMyAdmin..\e[39m" + wget -q -N "https://files.phpmyadmin.net/phpMyAdmin/$PHPMYADMINV/phpMyAdmin-$PHPMYADMINV-all-languages.zip" >/dev/null & + show_spinner $! + unzip -o phpMyAdmin-$PHPMYADMINV-all-languages.zip >/dev/null & + show_spinner $! + mv phpMyAdmin-$PHPMYADMINV-all-languages /usr/share/phpmyadmin + chmod -R 0755 /usr/share/phpmyadmin + wget -q -N "https://backup.mirror3.deinserverhost.icu/OneClick/phpmyadmin.conf" + mv phpmyadmin.conf /etc/apache2/conf-available/ + a2enconf phpmyadmin + systemctl reload apache2 + mkdir -p /usr/share/phpmyadmin/tmp/ + chown -R www-data:www-data /usr/share/phpmyadmin/tmp/ + + echo -e "\n\e[92mConfiguring MariaDB...\e[39m" + echo "CREATE USER '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASS'; + GRANT ALL PRIVILEGES ON *.* TO '$DBUSER'@'localhost' WITH GRANT OPTION; + FLUSH PRIVILEGES;" > /home/LAMP.sql + + mysql -u root < /home/LAMP.sql + rm /home/LAMP.sql + service apache2 restart + OWNIP=`curl ifconfig.me` + + + echo -e "\n\e[92mWriting login details into file...\e[39m" + echo -e "\n + ########## Phpmyadmin ##########\n + # http://$OWNIP/phpmyadmin/ + # Username: $DBUSER \n + # Password: $DBPASS \n + ########## ## END ## ##########\n + \n" > /home/LAMP-Login-Details-README.txt + echo -e "\n\e[92mLogin details written to \e[93m/home/LAMP-Login-Details-README.txt \e[39m" + + +} + @@ -131,13 +192,13 @@ if [ "$VAR_A" = "x86_64" ]; then if [ $version -eq 10 ]; then #Debian 10 - echo -e "\nDebian $version\e[39m" + echo -e "\nDebian $version \e[39m" install_Debian9 # Currently it also works for Debian 10 clean_up elif [ $version -eq 9 ]; then #Debian 9 Check - echo -e "\nDebian $version\e[39m" + echo -e "\nDebian $version \e[39m" install_Debian9 clean_up @@ -145,7 +206,9 @@ if [ "$VAR_A" = "x86_64" ]; then elif [ $version -eq 8 ]; then #Debian 8 Check - echo "Debian $version\e[39m" + echo "Debian $version \e[39m" + install_debian8 + clean_up fi