L'Antre du Tryphon
This post contains notes to install Apache2, MySQL and PHP on a Ubuntu Server 22.04. This is not a tutorial but a checklist.
Install the required softwares
apt-get install apache2service apache2 statusapt-get install mysql-serverservice mysql statusmysql_secure_installationCREATE USER 'phpbb'@'localhost' IDENTIFIED BY 'www';create database www;GRANT ALL PRIVILEGES ON www.* TO 'phpbb'@'localhost' WITH GRANT OPTION;FLUSH PRIVILEGES;apt-get install php8.1-fpm php8.1 libapache2-mod-php8.1 php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl php8.1-bcmath php-json php-mbstring php-xmlapt-get install unzipupload_max_filesize = 32Mpost_max_size = 48Mmemory_limit = 256Mmax_execution_time = 120max_input_vars = 300max_input_time = 1000a2dissite 000-defaultchown -R www-data:www-data /var/www/html/newsitefind /var/www/html/newsite -type d -exec chmod 755 {} \;find /var/www/html/newsite -type f -exec chmod 644 {} \;apt-get install apache2-utilshtpasswd -c /etc/apache2/.htpasswd exampleuser<VirtualHost *:80> ServerAdmin admin@newsite.com ServerName www.newsite.com ServerAlias www.newsite.com DocumentRoot /var/www/html/newsite <Directory /var/www/html/newsite> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin admin@newsite.com ServerName www.newsite.com ServerAlias www.newsite.com SSLEngine on DocumentRoot /var/www/html/newsite <Directory /var/www/html/newsite> Options -Indexes +FollowSymLinks AuthType Basic AuthName "Restricted Content: You are not welcome!" AuthUserFile /etc/apache2/.htpasswd Require valid-user </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLCertificateFile /etc/letsencrypt/live/www.newsite.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.newsite.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule> a2enmod sslena2site newsite