Proper Apache 2.4.x config
Posted: Tue Feb 16, 2016 2:21 pm
All,
I think the docs for SSL need to be updated to fully document correct config on RHEL7 / Apache 2.4.x:
/etc/httpd/conf.d/nagiosxi.conf
This config will accept all connections on :80 and redirect correctly to https
Per Apache docs http://httpd.apache.org/docs/2.4/upgrading.html:
2.2 configuration:
Order allow,deny
Allow from all
2.4 configuration:
Require all granted
I think the docs for SSL need to be updated to fully document correct config on RHEL7 / Apache 2.4.x:
/etc/httpd/conf.d/nagiosxi.conf
Code: Select all
<VirtualHost *:80>
<Directory "/usr/local/nagiosxi/html">
# SSLRequireSSL
Options None
AllowOverride None
# Order allow,deny
# ^^DEPRICATED IN 2.4!
# Allow from all
# ^^DEPRICATED IN 2.4!
Require all granted
Redirect permanent / https://MY.FQDN.HERE/
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "Nagios XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/my_cert_name_here.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory "/usr/local/nagiosxi/html">
AllowOverride All
require all granted
</Directory>
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
#</IfModule>
</VirtualHost>
Alias /nagiosxi "/usr/local/nagiosxi/html"
Per Apache docs http://httpd.apache.org/docs/2.4/upgrading.html:
2.2 configuration:
Order allow,deny
Allow from all
2.4 configuration:
Require all granted