Search code examples
apachesslubuntu-16.04ubuntu-server

Can't acces website when ssl enabled


We're trying to use SSL on our website. The website is on a ubuntu server 2016. I've generated certicates from let's encrypt and followed the ubuntu tutorial but at the end i'm getting ERR_CONNECTION_REFUSED

<VirtualHost *:443>

    ServerAdmin [email protected]
    ServerName dp7.sitename.eu
    ServerAlias www.dp7.sitename.eu

    #SSLEngine on
    #SSLCertificateFile      /etc/letsencrypt/live/sitename.fr/cert.pem
    #SSLCertificateChainFile /etc/letsencrypt/live/sitename.fr/fullchain.pem
    #SSLCertificateKeyFile  /etc/letsencrypt/live/sitename.fr/privkey.pem
        DocumentRoot /var/www/bt750
        <Directory "/var/www/bt750">
            Options +FollowSymLinks -MultiViews
            AllowOverride all
            Order allow,deny
            allow from all
        Require all granted
        </Directory>
    ErrorLog /var/log/apache2/dp7_ssl_error.log
    LogLevel warn
    CustomLog /var/log/apache2/dp7_ssl_access.log "combined"
</VirtualHost>

i have flushed all my chrome cache, without success

how can i solve this problem ?


Solution

  • You have some errors in apache configuration. You need Listen the 443 port and uncomment SLL configuration

    Listen 443
    <VirtualHost *:443>
    
        ServerAdmin [email protected]
        ServerName dp7.sitename.eu
        ServerAlias www.dp7.sitename.eu
    
        SSLEngine on
        SSLCertificateFile      /etc/letsencrypt/live/sitename.fr/cert.pem
        SSLCertificateChainFile /etc/letsencrypt/live/sitename.fr/fullchain.pem
        SSLCertificateKeyFile  /etc/letsencrypt/live/sitename.fr/privkey.pem
            DocumentRoot /var/www/bt750
            <Directory "/var/www/bt750">
                Options +FollowSymLinks -MultiViews
                AllowOverride all
                Order allow,deny
                allow from all
            Require all granted
            </Directory>
        ErrorLog /var/log/apache2/dp7_ssl_error.log
        LogLevel warn
        CustomLog /var/log/apache2/dp7_ssl_access.log "combined"
    </VirtualHost>