Overzicht van configuratie, beheer, modules, hardening en best practices.
Apache installeren op Ubuntu:
sudo apt update
sudo apt install apache2
/etc/apache2/apache2.conf/etc/apache2/conf-available/security.conf/etc/apache2/conf-enabled//etc/apache2/mods-available//etc/apache2/mods-enabled//etc/apache2/sites-available//etc/apache2/sites-enabled//var/www/html//var/log/apache2/Apache beheren via systemctl:
sudo systemctl start apache2
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl reload apache2
sudo systemctl status apache2
Apache’s eigen control interface:
sudo apache2ctl configtest
sudo apache2ctl graceful
sudo apache2ctl fullstatus
Modules inschakelen of uitschakelen:
sudo a2enmod modulenaam
sudo a2dismod modulenaam
sudo systemctl reload apache2
Veelgebruikte modules:
ssl — HTTPS ondersteuningrewrite — URL rewritingheaders — Security headersproxy, proxy_http — Reverse proxyhttp2 — HTTP/2 ondersteuningSite inschakelen of uitschakelen:
sudo a2ensite sitenaam.conf
sudo a2dissite sitenaam.conf
sudo systemctl reload apache2
Voorbeeld VirtualHost:
<VirtualHost *:443>
ServerName voorbeeld.nl
DocumentRoot /var/www/voorbeeld
SSLEngine on
SSLCertificateFile /etc/ssl/certs/voorbeeld.crt
SSLCertificateKeyFile /etc/ssl/private/voorbeeld.key
<Directory /var/www/voorbeeld>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
/var/log/apache2/error.log/var/log/apache2/access.logLive meekijken:
sudo tail -f /var/log/apache2/error.log
Voorbeeld sterke configuratie (A+ SSL Labs):
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!RC4
SSLHonorCipherOrder on
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
SSLCompression off
SSLSessionTickets off
mod_proxy_balancermod_ratelimitmod_headerssudo apache2ctl configtest
Altijd uitvoeren vóór een reload of restart.