Ab Apache 2.4 müssen mehrere Require-Directiven in <Require(All|Any|None)>-Container gruppiert werden, sonst gilt nur die jeweils letzte Require-Directive.
Ich habe Dir mal schnell eine kleine Standardkonfiguration erstellt, damit Du die Zusammenhänge besser verstehen kannst. Pfade solltest Du natürlich anpassen wenn Du die Konfiguration übernimmst und auch die Optionen nochmal prüfen.
Nagios wäre hier nur per HTTPS unter
https://host.domain.tld/nagios/ erreichbar. HTTP und HTTPS haben getrennte Docroots und Logs, sind also sauber getrennt. SSL/TLS ist sicher und trotzdem weitestgehend kompatibel konfiguriert. Wenn Du SNI nicht verwendest, dann bitte SSLStrictSNIVHostCheck löschen.
Code: Select all
<Directory "/">
Options None +FollowSymLinks
AllowOverride None
<RequireAll>
Require method GET POST OPTIONS
Require all denied
</RequireAll>
</Directory>
<FilesMatch "^[\._]">
Require all denied
</FilesMatch>
<IfModule ssl_module>
Listen 443
SSLRandomSeed startup file:/dev/urandom 512
SSLRandomSeed connect file:/dev/urandom 512
SSLPassPhraseDialog builtin
<IfModule socache_shmcb_module>
SSLSessionCache "shmcb:/var/run/ssl_scache(512000)"
</IfModule>
<IfModule !socache_shmcb_module>
<IfModule socache_dbm_module>
SSLSessionCache "dbm:/var/run/ssl_scache"
</IfModule>
<IfModule !socache_dbm_module>
SSLSessionCache "nonenotnull"
</IfModule>
</IfModule>
SSLSessionCacheTimeout 300
SSLCompression Off
SSLHonorCipherOrder On
SSLStrictSNIVHostCheck On
SSLProtocol -ALL +TLSv1 +TLSv1.2
SSLCipherSuite "EECDH+AES256 EECDH+AES128 EDH+AES256 EDH+AES128 !CAMELLIA !RC4 !3DES !IDEA !SEED !PSK !SRP !DSS !eNULL !aNULL !LOW !EXP"
<FilesMatch "\.(php|phps|php5|phtml|cgi|pl|py|shtml)$">
SSLOptions +StdEnvVars
</FilesMatch>
</IfModule>
<VirtualHost *:80>
ServerName host.domain.tld
CustomLog "/data/www/vhosts/host.domain.tld/logs/access_log" combined
ErrorLog "/data/www/vhosts/host.domain.tld/logs/error_log"
DocumentRoot "/data/www/vhosts/host.domain.tld/data"
<Directory "/data/www/vhosts/host.domain.tld/data">
Options None +FollowSymLinks
AllowOverride None
<RequireAll>
Require method GET POST OPTIONS
Require all granted
</RequireAll>
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName host.domain.tld
CustomLog "/data/www/vhosts/host.domain.tld/logs/ssl_access_log" combined
ErrorLog "/data/www/vhosts/host.domain.tld/logs/ssl_error_log"
DocumentRoot "/data/www/vhosts/host.domain.tld/ssl_data"
<Directory "/data/www/vhosts/host.domain.tld/ssl_data">
Options None +FollowSymLinks
AllowOverride None
<RequireAll>
Require method GET POST OPTIONS
Require all granted
</RequireAll>
</Directory>
<DirectoryMatch "(/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)">
Options None +FollowSymLinks
AllowOverride None AuthConfig
AuthType Digest
AuthName "Nagios Access"
AuthDigestDomain /nagios https://host.domain.tld/nagios
AuthBasicProvider file
AuthUserFile "/etc/nagios3/htpasswd.users"
<RequireAll>
Require method GET POST OPTIONS
Require ip meine_ip
Require valid-user
</RequireAll>
</DirectoryMatch>
SSLEngine on
SSLCertificateFile "/data/pki/certs/host.domain.tld.crt"
SSLCertificateKeyFile "/data/pki/private/host.domain.tld.key"
SSLCertificateChainFile "/data/pki/ca/component-ca-chain.pem"
</VirtualHost>
Hoffe es hilft Dir weiter.