Add new certificate for apache error

Hi i'm trying to add a certificate for a new domain.

When i execute:
sudo certbot --apache --apache-server-root /etc/apache2

I get this error:

Error running command ['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG'] for runtime parameters!

The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError("Error accessing loaded Apache parameters: ['apache2ctl', '-t', '-D', 'DUMP_RUN_CFG']")


Am i missing something? Shouldn't --apache-server-root be enough?

Certbot Version:
certbot 2.8.0

Root Information from Command apachectl -S
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"

Hi @linuxnoob2, and welcome to the LE community forum :slight_smile:

You shouldn't have to say that.
What happens without it?

3 Likes

I get the same error, thats why i added the parameter for the apache path :slight_smile:

I see a "2" in one of those ...

2 Likes

Do you really need to use the --apache plugin?
Can you use the --webroot plugin instead?

3 Likes

Like this?
sudo certbot --webroot

This works with apache?

Is that a problem?

No.

Like this:
sudo certbot --webroot -w /actual/path -d your.domain.name(s)

It works "with" any working web service.
You only need to know the domain name(s) and their DocumentRoot path(s).

3 Likes

Yes; It seems to be a problem for the plugin.

3 Likes

Is there a solution? Another command i could use? Or is it possible to do it manually in config files`

I thought I gave you one...

Start by showing:
sudo apachectl -t -D DUMP_VHOSTS

3 Likes

Didn't see it. So i presume that /actual/path is the path to the host conf?

"/actual/path" is a placeholder for:
The "DocumentRoot" path found in the vhost config file that covers "your.domain.name(s)" [also a placeholder].

The vhost config file can be found with the output of:
sudo apachectl -t -D DUMP_VHOSTS
[which is I asked for you to start there]

3 Likes

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