1

I'm trying to use certbot to get a certificate for my http server running nextcloud (archarm on a raspi). When I run: $ sudo certbot --apache, I get:

$ sudo certbot --apache      
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated)  (Enter 'c' to cancel): 

I then enter my domain: example.duckdns.org upon which I get:

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.duckdns.org
Cleaning up challenges
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.

While I do have example_duckdns.conf in /etc/httpd/conf/extra which looks like:

<Directory /var/www/html/nextcloud>
    Require all granted
</Directory>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/nextcloud"
    ServerName example.duckdns.org
    ServerAlias example.duckdns.org
    ServerAdmin example@mymail.com
    ErrorLog "/var/log/httpd/error_log_example_duckdns_org"
    CustomLog "/var/log/httpd/access_log_example_duckdns_org" combined
</VirtualHost>

And I get:

$ apachectl configtest        
Syntax OK

What do I have wrong?

Using: Apache/2.4.43

  • @telcoM yep, you're right, I did not include my VirtualHost file n the Apache conf. Once I did this, the domain was recognized correctly! You can move this comment into an aswer and I'll accept gladly! Thanks! – BitFreak Jul 22 '20 at 13:39
1

Sure, your /etc/httpd/conf/extra looks correct, but does your main Apache configuration file (or any file included by it) have anything like Include /etc/httpd/conf/extra or IncludeOptional /etc/httpd/conf/* in it anywhere?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.