Virtual host

Créer un nouveau Virtual host Apache

sudo nano /etc/apache2/sites-available/pixelfed.cogip.be.conf

Et compléter par

<VirtualHost *:80>
    ServerName pixelfed.cogip.be
    DocumentRoot /usr/share/webapps/pixelfed/public
    <Directory /usr/share/webapps/pixelfed/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/pixelfed-cogip-be.error.log
    CustomLog ${APACHE_LOG_DIR}/pixelfed-cogip-be.access.log combined

    # Real client IP and protocol
    RemoteIPHeader X-Forwarded-For
    RemoteIPTrustedProxy 192.168.0.80

    # Original scheme is HTTPS
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Ssl "on"

    # Send requests for PHP files to the PHP-FPM socket
    ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/run/php/pixelfed.sock|fcgi://localhost/usr/share/webapps/pixelfed/public/
</VirtualHost>

Activer le virtual host et désactiver celui d'Apache par défaut:

sudo a2ensite pixelfed.cogip.be.conf
sudo a2dissite 000-default.conf

Et redémarrer Apache

sudo systemctl reload apache2