How can i use certbot with nginx installed to a custom directory

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. crt.sh | 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:
thekidslepthere.com

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):
Ubuntu 20.04
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
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
1.27.0

I'm using passenger-nginx-module It's nginx but it installs the nginx binary in the folder /opt/nginx/sbin I could have chosen any folder but I don't think I could have used /usr/bin or /usr/sbin because it would obscure the system and the passenger versions and would just be bad convention
When I run the command:
sudo certbot nginx
I get the following error:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.")

Please see the Certbot help text for the nginx plugin by running:

certbot --help nginx

2 Likes

The answer isn't in there Could you please just answer the question instead of telling me what to read

Run nginx -V, if it can't find the command set your path so it includes the nginx bin folder.

2 Likes

I don't understand, how do you mean, "it isn't there"? It provides options to tell Certbot where the nginx directory is and, if necessary, where the nginx binary is. That should do the trick?

Have you tried the options? If so, which exact command did you use and what was the output?

You might not like that, but I categorically refuse to "just answer the question". I believe in teaching someone to fish, so one can feed themselves for a lifetime, instead of just handing out a fish so one can eat for just a single day.

4 Likes

OK I see it now There's path to nginx server root and nginx binary also I understand path to binary what do they mean by path to server root?

The path to the directory containing nginx.conf is usually the server root.

2 Likes

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