sudo apt update && sudo apt install apache2 && sudo ufw allow "Apache Full" && sudo a2enmod ssl && sudo systemctl restart apache2
<VirtualHost *:443>
ServerName your_domain_or_ip
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
sudo a2ensite default-ssl.conf && sudo apache2ctl configtest
Output:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
IP.2 = 192.168.2.194
IP.3 = 192.168.2.187
sudo chmod +x gerarcrtWithConfig.sh && sudo ./gerarcrtWithConfig.sh
RootCA-Publico.crt