diff --git a/Apache-Installer.sh b/Apache-Installer.sh index adfc1d4..921a2e2 100644 --- a/Apache-Installer.sh +++ b/Apache-Installer.sh @@ -68,17 +68,17 @@ a2enmod rewrite # PHP # ##---------## -apt install -y libapache2-mod-php php-mysql php-cgi php-common php-pear php-mbstring php-curl php-gd php-intl php-soap php-xml php-xmlrpc php-zip +apt install -y libapache2-mod-php php${phpver}-mysql php${phpver}-cgi php${phpver}-common php${phpver}-pear php${phpver}-mbstring php${phpver}-curl php${phpver}-gd php${phpver}-intl php${phpver}-soap php${phpver}-xml php${phpver}-xmlrpc php${phpver}-zip -sed -i 's/;opcache.memory_consumption=128/opcache.memory_consumption=256/g' /etc/php/7.2/apache2/php.ini -sed -i 's/;opcache.enable=1/opcache.enable=1/g' /etc/php/7.2/apache2/php.ini -sed -i 's/;opcache.interned_strings_buffer=8/opcache.interned_strings_buffer=8/g' /etc/php/7.2/apache2/php.ini -sed -i 's/;opcache.max_accelerated_files=10000/opcache.max_accelerated_files=50000/g' /etc/php/7.2/apache2/php.ini -sed -i 's/;opcache.max_wasted_percentage=5/opcache.max_wasted_percentage=5/g' /etc/php/7.2/apache2/php.ini -sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=0/g' /etc/php/7.2/apache2/php.ini -sed -i 's/; max_input_vars = 1000/max_input_vars = 10000/g' /etc/php/7.2/apache2/php.ini -sed -i 's/upload_max_filesize = 2/upload_max_filesize = 128/g' /etc/php/7.2/apache2/php.ini -sed -i 's/post_max_size = 8/post_max_size = 64/g' /etc/php/7.2/apache2/php.ini +sed -i 's/;opcache.memory_consumption=128/opcache.memory_consumption=256/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/;opcache.enable=1/opcache.enable=1/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/;opcache.interned_strings_buffer=8/opcache.interned_strings_buffer=8/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/;opcache.max_accelerated_files=10000/opcache.max_accelerated_files=50000/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/;opcache.max_wasted_percentage=5/opcache.max_wasted_percentage=5/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/;opcache.revalidate_freq=2/opcache.revalidate_freq=0/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/; max_input_vars = 1000/max_input_vars = 10000/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/upload_max_filesize = 2/upload_max_filesize = 128/g' /etc/php/"$phpver"/apache2/php.ini +sed -i 's/post_max_size = 8/post_max_size = 64/g' /etc/php/"$phpver"/apache2/php.ini ##----------------## # PHPMyAdmin # @@ -150,8 +150,16 @@ fi ##-------------## apt install -y python-certbot-apache -certbot --apache -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos -certbot --apache -n -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos + +if [ $domainwww = 1 ]; then + certbot --apache -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos + echo "certbot --apache -n -d $domain -d www.$domain -m $email --hsts --redirect --no-eff-email --agree-tos" > ~/certbotactivate.sh + +elif [ $domainwww = 0 ]; then + certbot --apache -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos + echo "certbot --apache -n -d $domain -m $email --hsts --redirect --no-eff-email --agree-tos" > ~/certbotactivate.sh +fi + ##---------------## @@ -241,5 +249,5 @@ chown -R www-data:www-data /var/www/"$domain"/html ##----------------------## sed -i '3i\ Protocols h2 http/1.1\' /etc/apache2/sites-available/ictdagbesteding.nl-le-ssl.conf -wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/dev/Apache_PHP-FPM_Installer.sh -O h2_fix.sh +wget https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Web/raw/branch/master/Apache_PHP-FPM_Installer.sh -O h2_fix.sh source h2_fix.sh \ No newline at end of file