Using non system nginx

hi all

so when i run this

certbot certonly --nginx

says its not running on this server but this server is running nginx, just it doesnt use the system one, uses another one installed by another sofware and its running in

/opt/aspera/shares/nginx

is there anyway i can make certbot use the software installed nginx version?

thanks,
rob

1 Like

Maybe. You could try setting these options on certbot command:

nginx:
  Nginx Web Server plugin

  --nginx-server-root NGINX_SERVER_ROOT
                        Nginx server root directory. (default: /etc/nginx or
                        /usr/local/etc/nginx)
  --nginx-ctl NGINX_CTL
                        Path to the 'nginx' binary, used for 'configtest' and
                        retrieving nginx version number. (default: nginx)
5 Likes

doesnt work, i get this

certbot certonly --nginx-server-root /opt/aspera/shares/etc/nginx -d domain.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?


1: Apache Web Server plugin (apache)
2: Spin up a temporary webserver (standalone)
3: Place files in webroot directory (webroot)

1 Like

I think you also need to include --nginx to specify that plug-in. The extra options are for that plugin.

3 Likes

tried to put the --nginx option either end of the nginx server root option and same reseult

when i put it at the end, get no error just syntax wrong

certbot certonly --nginx --nginx-server-root /opt/aspera/shares/etc/nginx -d domain.com
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.")

1 Like

I think you need to add this too.

--nginx-ctl "$(which nginx)"

(this is hacky as shit, put the actual path, even more when certbot complains about your PATH)

2 Likes

when you say the actual path, do you mean the server root, like below

/opt/aspera/shares/etc/nginx

1 Like

two different options, one points to the config (this is the one you have already), another to the nginx executable itself.

3 Likes

job done!!!!

certbot certonly --nginx --nginx-server-root /opt/aspera/shares/etc/nginx --nginx-ctl /opt/aspera/shares/sbin/nginx -d domain.com

and i spose renew, just make a crontab

0 09,21 * * * certbot renew

1 Like

You might already have one, or a systemd timer.

Check in /etc/cron.d and in systemctl list-timers

(if you add it manually, I'd add -q, as in certbot renew -q)

4 Likes

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