Centreon activerHTTPS
De SLM - MediaWiki
Sommaire
Installez le module SSL pour Apache :
yum install httpd24-mod_ssl openssl
Installez vos certificats, ou générez des certificats auto-signés :
Création du certificat de l'autorité de certification
Pour signer un certificat, vous devez devenir votre propre autorité de certification, cela implique donc de réaliser une clé et un certificat auto-signé.
- /etc/pki/tls/private/ca.key
cd /etc/pki/tls/private/ openssl genrsa 2048 > ca.key
- /etc/pki/tls/certs/ca.crt
openssl req -new -x509 -days 9999 -key ca.key > /etc/pki/tls/certs/ca.crt
Sauvegarder votre configuration Apache pour Centreon :
cp /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf{,.origin}
Editez la configuration comme suivant :
nano /opt/rh/httpd24/root/etc/httpd/conf.d/10-centreon.conf
# # Section add by Centreon Install Setup # Alias /centreon/api /usr/share/centreon Alias /centreon /usr/share/centreon/www/ <LocationMatch ^/centreon/(?!api/latest/|api/beta/|api/v[0-9]+/|api/v[0-9]+\.[0-9]+/)(.*\.php(/.*)?)$> ProxyPassMatch fcgi://127.0.0.1:9042/usr/share/centreon/www/$1 </LocationMatch> <LocationMatch ^/centreon/api/(latest/|beta/|v[0-9]+/|v[0-9]+\.[0-9]+/)(.*)$> ProxyPassMatch fcgi://127.0.0.1:9042/usr/share/centreon/api/index.php/$1 </LocationMatch> ProxyTimeout 300 '''ServerName localhost <VirtualHost *:80> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key''' <Directory "/usr/share/centreon/www"> DirectoryIndex index.php Options Indexes AllowOverride all Order allow,deny Allow from all Require all granted <IfModule mod_php5.c> php_admin_value engine Off </IfModule> AddType text/plain hbs </Directory> <Directory "/usr/share/centreon/api"> Options Indexes AllowOverride all Order allow,deny Allow from all Require all granted <IfModule mod_php5.c> php_admin_value engine Off </IfModule> AddType text/plain hbs </Directory> '''</VirtualHost>''' RedirectMatch ^/$ /centreon
Redémarrage des services
systemctl daemon-reload systemctl restart httpd24-httpd.service
On vérifie qu'il n'y à pas d'erreur
systemctl status httpd24-httpd.service