Typo3

Apache/Nginx, mariadb(sql) und php8.x sind vorhanden

apt install php8.4 php8.4-cli php8.4-mysql php8.4-gd php8.4-xml php8.4-mbstring php8.4-intl php8.4-curl php8.4-zip unzip imagemagick
CREATE DATABASE typo3 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'typo3user'@'localhost' IDENTIFIED BY 'cOOl3sP4sSWort';
GRANT ALL PRIVILEGES ON typo3.* TO 'typo3user'@'localhost';
FLUSH PRIVILEGES;
cd /var/www
mkdir t3za
chown www-data t3za/
cd t3za/
sudo -u www-data composer create-project typo3/cms-base-distribution typo3-site
mv typo3-site /var/www/

just to be sure:

chown -R www-data:www-data /var/www/typo3-site
find /var/www/typo3-site -type d -exec chmod 755 {} \;
find /var/www/typo3-site -type f -exec chmod 644 {} \;

Die Verzeichnis und Dateirechte sollten bei einem „normalen“ Benutzer liegen, nicht bei www-data!

chown -R sascha:sascha /var/www/typo3-site

allerdings muss der Webserver in einigen Verzeichnissen Schreibrechte bekommen. Sie werden bei der Installation über install.php angelegt, können aber auch vorher händisch erstellt werden.

mkdir -p /var/www/typo3-site/public/fileadmin \
         /var/www/typo3-site/public/typo3conf \
         /var/www/typo3-site/public/typo3temp \
         /var/www/typo3-site/var \
         /var/www/typo3-site/config
chown -R www-data:www-data /var/www/typo3-site/public/fileadmin \
    /var/www/typo3-site/public/typo3conf \
    /var/www/typo3-site/public/typo3temp \
    /var/www/typo3-site/var \
    /var/www/typo3-site/config

Webserver einstellen:

nano /etc/apache2/sites-available/typo3.conf

Um ein letsencrypt Zertifikat zu erstellen, muss Apache zunächst reloaded werden – dafür wird eine Dummy-Config erstellt:

nano /etc/apache2/sites-available/typo3.conf

Inhalt:

<VirtualHost *:80>
    ServerName typ3.pcmacb.de
    DocumentRoot /var/www/typo3-site/public

    <Directory /var/www/typo3-site/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
a2enmod typo3.conf
systemctl reload apache2 

nun kann das Zertifikat erstellt werden mit:

certbot --apache --cert-name typo3.yourdomain.tld -d typo3.yourdomain.tld

und der Inhalt der Config Datei angepasst werden:

<VirtualHost *:80>
    ServerName typo3.yourdomain.tld
    ServerAlias www.typo3.yourdomain.tld

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>

<VirtualHost *:443>
    ServerName typo3.yourdomain.tld
    ServerAlias www.typo3.yourdomain.tld

    DocumentRoot /var/www/typo3-site/public

    <Directory /var/www/typo3-site/public>
        AllowOverride All
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/typo3.yourdomain.tld/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/typo3.yourdomain.tld/privkey.pem
</VirtualHost>