Certificat ssl CentOS
Certificat ssl CentOS
Bonjour,
Je souhaiterai mettre en place un certificat SSL sur l'interface de EON, mon maître de stage m'a donné plusieurs fichiers avec comme extensions (.cer, .pfx, .pem et .key). Je comprend qu'il faut que je modifie le fichier ssl.conf et httpd.conf dans
J'ai modifié comme ci dessous dans le fichiern ssl.conf:
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.cer
SSLCertificateKeyFile /etc/pki/tls/private/PrivateKey_agglo-niort.pem
SSLCertificateChainFile /etc/pki/tls/certs/Intermediate-GlobalSign-OrganisationSSL-RSA-SHA2-primary.cer
Chaque fichiers se trouvent dans le bon répertoire
Je ne sais pas si c'est les bons fichier à mettre ici, mais ça ne marche pas et je pense qu'il y a autre à faire, mais je ne sais pas quoi
Si vous avez des lumières..
Cordialement
Je souhaiterai mettre en place un certificat SSL sur l'interface de EON, mon maître de stage m'a donné plusieurs fichiers avec comme extensions (.cer, .pfx, .pem et .key). Je comprend qu'il faut que je modifie le fichier ssl.conf et httpd.conf dans
J'ai modifié comme ci dessous dans le fichiern ssl.conf:
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.cer
SSLCertificateKeyFile /etc/pki/tls/private/PrivateKey_agglo-niort.pem
SSLCertificateChainFile /etc/pki/tls/certs/Intermediate-GlobalSign-OrganisationSSL-RSA-SHA2-primary.cer
Chaque fichiers se trouvent dans le bon répertoire
Je ne sais pas si c'est les bons fichier à mettre ici, mais ça ne marche pas et je pense qu'il y a autre à faire, mais je ne sais pas quoi
Si vous avez des lumières..
Cordialement
-
- Messages : 1017
- Inscription : 07 janvier 2014, 21:48
- Localisation : Angers, France
Re: Certificat ssl CentOS
Tu dois ajouter un "virtualhost" dans dans ton fichier de configuration apache:
Exemple simple:
Exemple simple:
Code : Tout sélectionner
<VirtualHost _default_:443>
DocumentRoot /var/www/html/monsite
ServerName monserver.mondomaine.xy
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /etc/pki/tls/certs/moncertificat.crt
SSLCertificateKeyFile /etc/pki/tls/private/macle.key
<Directory "/var/www/html/monsite">
Options +FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Re: Certificat ssl CentOS
J'avais déjà mis ça dans le fichier: /etc/httpd/conf/httpd.conf
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.cer
SSLCertificateKeyFile /etc/pki/tls/private/serverkey_agglo-niort.key
<Directory /var/www/html>
AllowOverride All
</Directory>
DocumentRoot /srv/eyesofnetwork/eonweb
ServerName www.agglo-niort.fr
</VirtualHost>
Mais ça ne marche pas pour l'instant, et je sais pas trop pourquoi
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.cer
SSLCertificateKeyFile /etc/pki/tls/private/serverkey_agglo-niort.key
<Directory /var/www/html>
AllowOverride All
</Directory>
DocumentRoot /srv/eyesofnetwork/eonweb
ServerName www.agglo-niort.fr
</VirtualHost>
Mais ça ne marche pas pour l'instant, et je sais pas trop pourquoi
-
- Messages : 1017
- Inscription : 07 janvier 2014, 21:48
- Localisation : Angers, France
Re: Certificat ssl CentOS
Tu utilises bien l'url "https://www.agglo-niort.fr" pour accéder à ton site ?
Y a t'il un fichier /var/www/html/index.html ? Ou /var/www/html/index.php ? Ou autre chose ?
As tu regardé les fichiers de logs qui sont dans /var/log/httpd quand tu essayes d'accéder à ton site ?
En faisant ceci, par exemple:
Le module ssl est-il bien chargé ? Apache écoute-il bien sur le port 443 ?
Regarde, aussi, ici: viewtopic.php?f=35&t=4383&p=13037&hilit ... ine#p13037
Y a t'il un fichier /var/www/html/index.html ? Ou /var/www/html/index.php ? Ou autre chose ?
As tu regardé les fichiers de logs qui sont dans /var/log/httpd quand tu essayes d'accéder à ton site ?
En faisant ceci, par exemple:
Code : Tout sélectionner
tail -f /var/log/httpd/error_log
Code : Tout sélectionner
LoadModule ssl_module modules/mod_ssl.so
Listen 443
Re: Certificat ssl CentOS
C'est un serveur donc j'y accède via l'adresse IP
Je n'ai strictement aucun fichier dans html
Avec la commande tail j'ai:
[Tue Feb 13 11:15:51.067711 2018] [lbmethod_heartbeat:notice] [pid 27919] AH02282: No slotmem from mod_heartmonitor
[Tue Feb 13 11:15:51.118482 2018] [mpm_prefork:notice] [pid 27919] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 mod_perl/2.0.9dev Perl/v5.16.3 configured -- resuming normal operations
[Tue Feb 13 11:15:51.118532 2018] [core:notice] [pid 27919] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Feb 13 12:05:12.818802 2018] [mpm_prefork:notice] [pid 27919] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Feb 13 12:05:16.015268 2018] [core:notice] [pid 15843] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Feb 13 12:05:16.016565 2018] [suexec:notice] [pid 15843] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 13 12:05:16.074907 2018] [auth_digest:notice] [pid 15843] AH01757: generating secret for digest authentication ...
[Tue Feb 13 12:05:16.076405 2018] [lbmethod_heartbeat:notice] [pid 15843] AH02282: No slotmem from mod_heartmonitor
[Tue Feb 13 12:05:16.129697 2018] [mpm_prefork:notice] [pid 15843] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 mod_perl/2.0.9dev Perl/v5.16.3 configured -- resuming normal operations
[Tue Feb 13 12:05:16.129742 2018] [core:notice] [pid 15843] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
Dans le fichier ssl.conf:
J'ai bien le "Listen 443"
Mais le LoadModule ne s'y trouve pas
Je n'ai strictement aucun fichier dans html
Avec la commande tail j'ai:
[Tue Feb 13 11:15:51.067711 2018] [lbmethod_heartbeat:notice] [pid 27919] AH02282: No slotmem from mod_heartmonitor
[Tue Feb 13 11:15:51.118482 2018] [mpm_prefork:notice] [pid 27919] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 mod_perl/2.0.9dev Perl/v5.16.3 configured -- resuming normal operations
[Tue Feb 13 11:15:51.118532 2018] [core:notice] [pid 27919] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Feb 13 12:05:12.818802 2018] [mpm_prefork:notice] [pid 27919] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Feb 13 12:05:16.015268 2018] [core:notice] [pid 15843] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Tue Feb 13 12:05:16.016565 2018] [suexec:notice] [pid 15843] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 13 12:05:16.074907 2018] [auth_digest:notice] [pid 15843] AH01757: generating secret for digest authentication ...
[Tue Feb 13 12:05:16.076405 2018] [lbmethod_heartbeat:notice] [pid 15843] AH02282: No slotmem from mod_heartmonitor
[Tue Feb 13 12:05:16.129697 2018] [mpm_prefork:notice] [pid 15843] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16 mod_perl/2.0.9dev Perl/v5.16.3 configured -- resuming normal operations
[Tue Feb 13 12:05:16.129742 2018] [core:notice] [pid 15843] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
Dans le fichier ssl.conf:
J'ai bien le "Listen 443"
Mais le LoadModule ne s'y trouve pas
-
- Messages : 1017
- Inscription : 07 janvier 2014, 21:48
- Localisation : Angers, France
Re: Certificat ssl CentOS
Ah oui ! Je n'avais pas vu la directive "DocumentRoot /srv/eyesofnetwork/eonweb".LeMass79 a écrit :Je n'ai strictement aucun fichier dans html
C'est, donc, dans ce répertoire "eonweb" que tu dois avoir des fichiers index.*
Tu peux vérifier ?
Cela dit, il y a, donc, un problème avec ta directive "<Directory /var/www/html>".
Tu dois la modifier comme ceci:
Code : Tout sélectionner
<Directory /srv/eyesofnetwork/eonweb>
AllowOverride All
Require all granted
</Directory>
As tu installé le paquet mod_ ssl ou le paquet mod_nss.x86_64 ? Qu'y a t'il dans /etc/httpd/conf.d/ssl.conf ?LeMass79 a écrit : Dans le fichier ssl.conf:
J'ai bien le "Listen 443"
Mais le LoadModule ne s'y trouve pas
Que donne ?
Code : Tout sélectionner
ls -dl /srv/eyesofnetwork/eonweb
getenforce
systemctl status firewalld
Re: Certificat ssl CentOS
Dans le répertoire eonweb j'ai:
bower_components bower.json cache css footer.php header.php images include index.php js login.php logout.php module README.md side.php
La directive est modifié.
La paquet mod_ssl est déjà installé mais le paquet mod_nssx86_64 n'étais pas installé, je viens de le faire.
Dans le fichier ssl.conf j'ai des lignes comme ça:
#DocumentRoot "/var/www/html"
#ServerName www.agglo-niort.fr:443
SSLEngine on
SSLProtocol all -SSLv2 -SSlv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
SSLHonorCipherOrder on
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.crt
SSLCertificateKeyFile /etc/pki/tls/private/serverkey_agglo-niort.key
SSLCertificateChainFile /etc/pki/tls/certs/Intermediate-GlobalSign-OrganisationSSL-RSA-SHA2-primary.crt
ls -dl /srv/eyesofnetwork/eonweb donne:
lrwxrwxrwx. 1 root eyesofnetwork 29 17 janv. 15:40 /srv/eyesofnetwork/eonweb -> /srv/eyesofnetwork/eonweb-5.1
getenforce donne:
Permissive
systemctl status firewalld donne:
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
bower_components bower.json cache css footer.php header.php images include index.php js login.php logout.php module README.md side.php
La directive est modifié.
La paquet mod_ssl est déjà installé mais le paquet mod_nssx86_64 n'étais pas installé, je viens de le faire.
Dans le fichier ssl.conf j'ai des lignes comme ça:
#DocumentRoot "/var/www/html"
#ServerName www.agglo-niort.fr:443
SSLEngine on
SSLProtocol all -SSLv2 -SSlv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
SSLHonorCipherOrder on
SSLCertificateFile /etc/pki/tls/certs/agglo-niort.fr.crt
SSLCertificateKeyFile /etc/pki/tls/private/serverkey_agglo-niort.key
SSLCertificateChainFile /etc/pki/tls/certs/Intermediate-GlobalSign-OrganisationSSL-RSA-SHA2-primary.crt
ls -dl /srv/eyesofnetwork/eonweb donne:
lrwxrwxrwx. 1 root eyesofnetwork 29 17 janv. 15:40 /srv/eyesofnetwork/eonweb -> /srv/eyesofnetwork/eonweb-5.1
getenforce donne:
Permissive
systemctl status firewalld donne:
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
-
- Messages : 1017
- Inscription : 07 janvier 2014, 21:48
- Localisation : Angers, France
Re: Certificat ssl CentOS
Mais c'est un lien symbolique !LeMass79 a écrit : ls -dl /srv/eyesofnetwork/eonweb donne:
lrwxrwxrwx. 1 root eyesofnetwork 29 17 janv. 15:40 /srv/eyesofnetwork/eonweb -> /srv/eyesofnetwork/eonweb-5.1
Tu dois utiliser un chemin réel avec la directive "DocumentRoot". Tu dois, aussi, mettre à jour la directive "Directory".
Re: Certificat ssl CentOS
Donc dans DocumentRoot je devrai mettre /srv/eyesofnetwork/eonweb-5.1 et idem pour la directive Directory ?
-
- Messages : 1017
- Inscription : 07 janvier 2014, 21:48
- Localisation : Angers, France
Re: Certificat ssl CentOS
Oui, n'hésite pas à tester par toi même.