Cerbot can't correctly handle httpd.conf


#1

I try to run the certbot client against my apache, where there’s the following VirtualHost defined (and it is the only one configured)

<VirtualHost *:80>
    DocumentRoot "/opt/lampp/htdocs/cip"
    ServerAdmin postmaster@cip.puglia.it
    ServerName cip.puglia.it
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    # Other directives here
</VirtualHost>

But the client apparently can’t correctly parse the http.conf file (located in /opt/lampp/apache2/conf/httpd.conf)

This happens with both the commands
certbot --apache
and
certbot --apache certonly

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

cip.puglia.it

I ran this command:
certbot --apache
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): cip.puglia.it
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for cip.puglia.it
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.

My web server is (include version):
Server version: Apache/2.4.6 (CentOS)
Server built: Oct 19 2017 20:39:16

The operating system my web server runs on is (include version):
CentOS Linux release 7.3.1611 (Core)
My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):
yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
no


#2

Hi @diomede,

Which version of Certbot are you running here?


#3

Hello,

I’m not sure, the executable does not seem to provide a version option.
I just see that it links ‘certbot-2’
I simply followed instructions at https://certbot.eff.org/lets-encrypt/centosrhel7-apache, so the version that you get when you run
sudo yum install certbot-apache


#4

You could run certbot --version to find out.


#5

thank you

certbot 0.22.2 is the answer


#6

Looks like you are running your Apache2 from a non-standard path. I would suggest trying to add --apache-server-root /opt/lampp/apache2/conf/ to your Certbot command line.


#7

Yes, this fixed the problem. Thank you!


#8

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