Certbot install (Debian/Apache)

Hello,

I'm sorry, I speak a little English.

Versions:

Debian GNU/Linux 11 (bullseye)
Apache/2.4.52 (Debian)
Certbot 1.12.0

My /etc/apache2/sites-available/example.com.conf file:

<VirtualHost *:80>

        ServerName example.com
        ServerAlias www.example.com
        DocumentRoot /var/www/example.com/public_html/
        AddDefaultCharset UTF-8
        AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
        AddType application/x-httpd-php .php
        ErrorLog /var/www/example.com/error_log
        CustomLog /var/www/example.com/access_log combined

        HostnameLookups Off
        UseCanonicalName Off
        ServerSignature Off
        IndexIgnore *
        ErrorDocument 500 "Error 500"
        ErrorDocument 403 "Error 403"

	<Directory "/var/www/example.com/public_html/">

                Options FollowSymLinks MultiViews
                AllowOverride All
                Require all granted

        </Directory>

</VirtualHost>

It works:

a2ensite example.com.conf

I try:

apt install certbot
certbot certonly --webroot --webroot-path /var/www/example.com/public_html -d example.com --register-unsafely-without-email

The http it works in my browser, but the https it not works:

ERR_CONNECTION_REFUSED

Why? Thanks.

Hi @danii and welcome to the LE community forum :slight_smile:

What happened from that command?

Please show the output of:
apachectl -t -D DUMP_VHOSTS

2 Likes

You are using the "certonly" subcommand, which would not install the certificate in Apache. Did you add a HTTPS (port 443) VirtualHost? Did you know the meaning of "certonly" when you used that option?

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.