|
|
|
#RECOMMANDÉ :
|
|
|
|
|
|
|
|
**[Installation Certificat Let's Encrypt + Renouvellement automatisé](https://docs.itopie.ch/installation/apache/letsencrypt/)**
|
|
|
|
|
|
|
|
#SINON
|
|
|
|
|
|
|
|
## Installation : Apache
|
|
|
|
|
|
|
|
# apt-get install apache2 ssl-cert
|
|
|
|
|
|
|
|
### SSL seulement
|
|
|
|
|
|
|
|
# a2dissite default
|
|
|
|
# nano /etc/apache2/ports.conf
|
|
|
|
[comment]
|
|
|
|
--8<---------------cut here---------------start------------->8---
|
|
|
|
#NameVirtualHost *:80
|
|
|
|
#Listen 80
|
|
|
|
--8<---------------cut here---------------end--------------->8---
|
|
|
|
# service apache2 restart
|
|
|
|
Restarting web server: apache2no listening sockets available, shutting down
|
|
|
|
Unable to open logs
|
|
|
|
Action 'start' failed.
|
|
|
|
The Apache error log may have more information.
|
|
|
|
failed!
|
|
|
|
# telnet localhost 80
|
|
|
|
Trying ::1...
|
|
|
|
Trying 127.0.0.1...
|
|
|
|
telnet: Unable to connect to remote host: Connection refused
|
|
|
|
# a2enmod ssl
|
|
|
|
# service apache2 restart
|
|
|
|
# telnet localhost 443
|
|
|
|
Trying ::1...
|
|
|
|
Connected to localhost.
|
|
|
|
Escape character is '^]'.
|
|
|
|
^]
|
|
|
|
telnet> quit
|
|
|
|
Connection closed.
|
|
|
|
# a2ensite default-ssl
|
|
|
|
# mv /etc/apache2/sites-enabled/default-ssl /etc/apache2/sites-enabled/000-default-ssl
|
|
|
|
# service apache2 reload
|
|
|
|
# w3m https://$(hostname -f)
|
|
|
|
# etckeeper commit 'apache2/*: SSL only'
|
|
|
|
|
|
|
|
|
|
|
|
### (Prod) Désactiver la signature (indication de version) serveur
|
|
|
|
|
|
|
|
# nano /etc/apache2/apache2.conf
|
|
|
|
[at the end, add]
|
|
|
|
ServerSignature Off
|
|
|
|
ServerTokens Prod |