Apache HTTP Neuinstallation (Linux)

Aus Tutorials
Zur Navigation springen Zur Suche springen

Deinstallieren

LetsEncrypt

Konfiguration sichern

Siehe auch LetsEncrypt#Backup

Links sichern (müssen bei einem Restore manuell wiederhergestellt werden)
sudo ls -l /etc/letsencrypt/live/baikal.kirner.or.at
lrwxrwxrwx 1 root root  43 Oct 23 23:31 cert.pem -> ../../archive/baikal.kirner.or.at/cert2.pem
lrwxrwxrwx 1 root root  44 Oct 23 23:31 chain.pem -> ../../archive/baikal.kirner.or.at/chain2.pem
lrwxrwxrwx 1 root root  48 Oct 23 23:31 fullchain.pem -> ../../archive/baikal.kirner.or.at/fullchain2.pem
lrwxrwxrwx 1 root root  46 Oct 23 23:31 privkey.pem -> ../../archive/baikal.kirner.or.at/privkey2.pem
sudo ls -l /etc/letsencrypt/renewal
-rw-r--r-- 1 root root 554 Oct 23 23:31 baikal.kirner.or.at.conf
Dateien sichern
sudo su
cd /etc/letsencrypt
sudo tar -cvzf 2020_11_28__LetsEncryptFullBackupWeb1.tgz accounts/ archive/ renewal/
sudo exit

sudo mv /etc/letsencrypt/2020_11_28__LetsEncryptFullBackupWeb1.tgz /media/backup/web1/Zertifikate/

Apache HTTP

Konfiguration sichern

sudo mkdir -p /media/backup/web1/apache/2020_11_28/sites-available
sudo mkdir -p /media/backup/web1/apache/2020_11_28/conf-available
sudo cp --preserve=mode,timestamps,links,xattr /etc/apache2/sites-available/* /media/backup/web1/apache/2020_11_28/sites-available/
sudo cp --preserve=mode,timestamps,links,xattr /etc/apache2/conf-available/* /media/backup/web1/apache/2020_11_28/conf-available/

Deinstallieren

sudo apt-get --purge remove apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils augeas-lenses libaugeas0 python3-augeas rpi-eeprom-images
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apache2* python-certbot-apache* python3-certbot-apache*
0 upgraded, 0 newly installed, 3 to remove and 6 not upgraded.
After this operation, 1,033 kB disk space will be freed.

php

installierte php-Versionen anzeigen

apt list --installed | grep php

php7.1

sudo apt-get --purge remove php7.1-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils augeas-lenses libaugeas0 libmcrypt4 python3-augeas rpi-eeprom-images
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  php7.1-common* php7.1-mcrypt*
0 upgraded, 0 newly installed, 2 to remove and 6 not upgraded.
After this operation, 4,234 kB disk space will be freed.
Do you want to continue? [Y/n]

php7.3

sudo apt-get --purge remove php7.3-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils augeas-lenses fonts-droid-fallback fonts-noto-mono ghostscript gsfonts imagemagick-6-common libaugeas0 libcupsfilters1 libcupsimage2 libde265-0 libfftw3-double3
  libgd3 libgs9 libgs9-common libheif1 libijs-0.35 libjbig2dec0 libldb1 liblqr-1-0 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmcrypt4 libopenjp2-7 libpaper-utils libpaper1 libsmbclient
  libsodium23 libtdb1 libtevent0 libtidy5deb1 libwebpmux3 libx265-165 libxslt1.1 libzip4 poppler-data python-talloc python3-augeas rpi-eeprom-images samba-libs ttf-dejavu-core
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libapache2-mod-php* libapache2-mod-php7.3* php* php-bcmath* php-curl* php-fpm* php-gd* php-gmp* php-igbinary* php-imagick* php-intl* php-json* php-ldap* php-mbstring* php-mysql* php-redis*
  php-smbclient* php-tidy* php-xml* php-zip* php7.3* php7.3-bcmath* php7.3-cli* php7.3-common* php7.3-curl* php7.3-fpm* php7.3-gd* php7.3-gmp* php7.3-intl* php7.3-json* php7.3-ldap*
  php7.3-mbstring* php7.3-mysql* php7.3-opcache* php7.3-readline* php7.3-tidy* php7.3-xml* php7.3-zip*
0 upgraded, 0 newly installed, 38 to remove and 6 not upgraded.
After this operation, 21.9 MB disk space will be freed.
Do you want to continue? [Y/n]

php-common

sudo apt-get --purge remove php-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils augeas-lenses fonts-droid-fallback fonts-noto-mono ghostscript gsfonts imagemagick-6-common libaugeas0 libcupsfilters1 libcupsimage2 libde265-0 libfftw3-double3
  libgd3 libgs9 libgs9-common libheif1 libijs-0.35 libjbig2dec0 libldb1 liblqr-1-0 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmcrypt4 libopenjp2-7 libpaper-utils libpaper1 libsmbclient
  libsodium23 libtdb1 libtevent0 libtidy5deb1 libwebpmux3 libx265-165 libxslt1.1 libzip4 poppler-data python-talloc python3-augeas rpi-eeprom-images samba-libs ttf-dejavu-core
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  php-common*
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 71.7 kB disk space will be freed.
Do you want to continue? [Y/n]

Installierte Pakete web1 am 28.11.2020

libapache2-mod-php7.3/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
libapache2-mod-php/stable,now 2:7.3+69 all [installed]
php-bcmath/stable,now 2:7.3+69 all [installed]
php-common/stable,now 2:69 all [installed]
php-curl/stable,now 2:7.3+69 all [installed]
php-fpm/stable,now 2:7.3+69 all [installed]
php-gd/stable,now 2:7.3+69 all [installed]
php-gmp/stable,now 2:7.3+69 all [installed]
php-igbinary/stable,now 3.0.0-1 armhf [installed,automatic]
php-imagick/stable,now 3.4.3-4.1 armhf [installed]
php-intl/stable,now 2:7.3+69 all [installed]
php-json/stable,now 2:7.3+69 all [installed]
php-ldap/stable,now 2:7.3+69 all [installed]
php-mbstring/stable,now 2:7.3+69 all [installed]
php-mysql/stable,now 2:7.3+69 all [installed]
php-redis/stable,now 4.2.0-1 armhf [installed]
php-smbclient/stable,now 0.9.0-3+b1 armhf [installed]
php-tidy/stable,now 2:7.3+69 all [installed]
php-xml/stable,now 2:7.3+69 all [installed]
php-zip/stable,now 2:7.3+69 all [installed]
php7.1-common/stable,now 7.1.20-1+b2 armhf [installed,automatic]
php7.1-mcrypt/stable,now 7.1.20-1+b2 armhf [installed]
php7.3-bcmath/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-cli/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-common/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-curl/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-fpm/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-gd/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-gmp/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-intl/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-json/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-ldap/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-mbstring/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-mysql/stable,now 7.3.19-1~deb10u1 armhf [installed]
php7.3-opcache/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-readline/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-tidy/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-xml/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3-zip/stable,now 7.3.19-1~deb10u1 armhf [installed,automatic]
php7.3/stable,now 7.3.19-1~deb10u1 all [installed]
php/stable,now 2:7.3+69 all [installed]

Neu installieren

Raspbian

sudo apt-get update
sudo apt-get full-upgrade
sudo apt-get autoremove

Apache HTTP - Teil 1

php

sudo apt-get -y install php php-mbstring php-xml libapache2-mod-php php-mysql php-bcmath php-curl php-fpm php-gd \
php-gmp php-igbinary php-imagick php-intl php-json php-ldap php-redis php-smbclient php-tidy php-zip

Module/Konfiguration aktivieren

sudo a2enmod proxy_fcgi setenvif && sudo a2enmod ssl && sudo a2enmod rewrite && sudo a2enmod proxy && \
sudo a2enmod proxy_http && sudo a2enmod proxy_html && sudo a2enmod dav && sudo a2enmod dav_svn && \
sudo a2enmod dav_fs && sudo a2enmod headers && sudo a2enmod env && sudo a2enmod dir && sudo a2enmod mime && \
sudo a2enmod auth_digest.load  && sudo a2enmod cgi && sudo a2enmod cgi && sudo a2enmod php7.3
sudo a2enconf php7.3-fpm
sudo service apache2 restart

LetsEncrypt

Neu installieren

sudo apt-get install certbot python-certbot-apache python-certbot-apache-doc

Konfiguration wiederherstellen

Sollte normal nicht notwendig sein, da LetsEnscrypt nur normal de-installiert wurde.

Falls es jedoch Probleme gibt, kann die Sicherung vom Beginn wiederhergestellt werden - siehe dazu LetsEncrypt#Restore

Apache HTTP - Teil 2

Konfiguration wiederherstellen

Siehe auch Apache HTTP#Installation

sudo cp --preserve=mode,timestamps,links,xattr /media/backup/web1/apache/2020_11_28/sites-available/* /etc/apache2/sites-available/
sudo cp --preserve=mode,timestamps,links,xattr /media/backup/web1/apache/2020_11_28/conf-available/* /etc/apache2/conf-available/

cd /etc/apache2/sites-available/
sudo a2ensite *.conf
cd /etc/apache2/conf-available/
sudo a2enconf *.conf

sudo systemctl reload apache2.service


Zurück zu Apache HTTP