Saving debug log to /var/log/letsencrypt/letsencrypt.log
Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError('Could not find configuration root')
The apache plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError('Could not find configuration root')
If you're running a custom Apache (compiled yourself for example), the certbotapache plugin can have a hard time finding it. You might be able get things working using the --apache-server-root command line option and its related options such as --apache-ctl. See all command line options with certbot --help all or check them out online in the certbot documentation.
# sudo certbot --apache-server-root -d DOMAIN.com
usage:
certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...
Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: argument --apache-server-root: expected one argument
Eeeehh, you obviously need to read what the option is for. You can't just copy/paste something without reading about it. Please see the command certbot --help all or the certbot documentation linked above.
Yeah, I am facing the exact same errors. I am not able to install certbot using either of sudo certbot --apache or sudo certbot certonly --apache with the message NoInstallationError('Could not find configuration root')
I also tried going through certbot --help all but couldn't able to figure our as for few commands it was showing error message as 'expected one argument'
It's a very lengthy output for apachectl -S.
Starting with 'VirtualHost Configuration:' to some apache server details.
Is there any thing particular you want to know from the output?
Hm, the current certbot apache module for CentOS expects to find all the Apache stuff in /etc/httpd/? See:
That's probably the reason. Has the Apache package been updated recently in CentOS perhaps? Or did you install it with aid of cPanel? Running apachectl -V might shed some extra light on the situation.
Ah yes, I saw somewhere online that when Apache is installed with aid of cPanel, it uses the /etc/apache2/ root while usually when Apache is installed using the CentOS package manager, it seems to get installed with the root /etc/httpd/. This might also be the issue @sys616 is having.
@Ravi97 & @sys616 You might get the certbot apache plugin running using --apache-server-root /etc/apache2 , --apache-challenge-location /etc/apache2 and --apache-vhost-root /etc/apache2/conf.d/ (not sure about the paths of the latter two though!) as extra commands.
@certbot-devs Any idea for a long term solution for this? I'm sure we don't want to fiddle with --apache-server-root /etc/apache2 for every user who installed Apache through cPanel?
Certbot is never going to work with cPanel, unless a plugin is written for it. My preference would be that Certbot warns the user against running in cPanel at all.
cPanel is an environment where Apache has its configuration managed externally by the hosting control panel software. Certbot would need to use the cPanel APIs rather than directly interacting with Apache like it usually does.
To @Ravi97 I would propose investigating whether you can use the built-in cPanel AutoSSL functionality. It works quite flawlessly without having to run any commands: Manage AutoSSL | cPanel & WHM Documentation. If it's not working for you, I'd look into getting it fixed.
If for some reason that's not an option for you, then you can use certonly+webroot:
Hm, true, if cPanel is used for everything, it doesn't make sense to use certbot indeed. I was thinking more like a scenario where cPanel perhaps was used only for installing Apache, but the user isn't using cPanel for anything else. I agree AutoSSL is a better option if cPanel is used mainly for maintenance of the server.