Trying the configure SSL on Apache2 on Ubuntu server installed Apache
sudo apt install apache2 Opened ufw firewall
sudo ufw allow 'Apache' ufw allow https Installed SSL files in /root/cert
chmod 400 /root/cert/* chmod 500 /root/cert/ In /etc/apache2/sites-available found two conf files: domainname.conf and default-ssl.conf DId not know which one to modify, so modified domainname.conf by adding following lines
<VirtualHost *:443> SSLEngine on SSLCertificateFile /root/cert/ca-bundle.crt SSLCertificateKeyFile /root/cert/Private.key SSLCertificateChainFile /root/cert/certificate.crt </VirtualHost> apachectl configtest apachectl restart iptables -A INPUT -p tcp --dport 443 -j ACCEPT systemctl enable apache2 --now netstat -ntlp | grep 80 tcp6 0 0 :::80 :::* LISTEN 899/apache2 netstat -ntlp | grep 443 returns nothing Added information - the website DNS resolution has not happened yet, because the nameserver is being changed. So I am checking on localhost. localhost:80 works, localhost:443 does not work gives error: localhost refused to connect
Several questions:
have I switched files SSLCertificateFile SSLCertificateChainFile by mistake since I did not which one was which. Also it has comment statement -----BEGIN CERTIFICATE----- and -----BEGIN CERTIFICATE-----
When I perform
apache2ctl configtest it says AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message Syntax OK
Is this a problem since nameserver is still pointing to old provider and I am in process of switching to new provider nameserver where the new website is running.
Can anyone help?
localhostis not the domain in the certificate ... so ... perhaps that's why whatever you are using to test is refusing to connect? hmm, just read it again, port 443 isn't even open