Having trouble renewing cert

:slight_smile: slight_smile: lease 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:
gamerplus.org

I ran this command:
sudo certbot --nginx - selected gamerplus.org

It produced this output:
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: gamerplus.org
Type: unauthorized
Detail: 69.173.194.5: Invalid response from http://gamerplus.org/.well-known/acme-challenge/tCRoTgjvN-ImVZRSzvif2poaJw832IHc0vsgzfKUIa4: 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.

My web server is (include version):
nginx version: nginx/1.26.0

The operating system my web server runs on is (include version):
Ubuntu 22.04

My hosting provider, if applicable, is:
self hosted

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):
certbot 1.21.0

Welcome @hairylarry

HTTP requests to that domain are handled by an Apache server. Not nginx. Can you explain more about how nginx and Apache work together?

Request to: gamerplus.org/69.173.194.5, Result: [Address=69.173.194.5,Address Type=IPv4,Server=Apache/2.4.52 (Ubuntu)

3 Likes

You got me on that one.

I get:

sudo apachectl status
/usr/sbin/apachectl: 113: www-browser: not found
'www-browser -dump http://localhost:80/server-status' failed.

sudo ufw status
Status: active

To Action From


Nginx Full ALLOW Anywhere
40000:50000/tcp ALLOW Anywhere
20,21,990/tcp ALLOW Anywhere
30000:31000/tcp ALLOW Anywhere
Nginx Full (v6) ALLOW Anywhere (v6)
40000:50000/tcp (v6) ALLOW Anywhere (v6)
20,21,990/tcp (v6) ALLOW Anywhere (v6)
30000:31000/tcp (v6) ALLOW Anywhere (v6)

Also

sudo systemctl status nginx
● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─restart.conf
Active: active (running) since Sun 2024-05-12 22:46:33 CDT; 11h ago
Docs: nginx documentation
Process: 1218 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 1302 (nginx)
Tasks: 6 (limit: 14101)
Memory: 37.8M
CPU: 2min 13.235s
CGroup: /system.slice/nginx.service
β”œβ”€ 1302 "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf"
β”œβ”€440376 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
β”œβ”€440377 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
β”œβ”€440378 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
β”œβ”€440379 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
└─440380 "nginx: cache manager process" "" "" "" "" "" "" "" "" "" "" "" ""

May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:29 njhb.org nginx[1218]: nginx: [warn] the "listen ... http2" directive is deprecated, use>
May 12 22:46:31 njhb.org nginx[1218]: nginx: [warn] "ssl_stapling" ignored, host not found in OCSP resp>
May 12 22:46:33 njhb.org systemd[1]: Started nginx - high performance web server.

I have a lot of deprecated listen warnings. Don't know what that's about either.

And thanks for your help.

1 Like

I still see Apache replying to HTTP (port 80) requests. Your nginx is handling HTTPS

Let's see if we can find out where this Apache is. What does this show

sudo ss -pant | grep -i listen | grep -E ':80|:443'

Here is the reply I see to HTTP requests (note Apache on Ubuntu)

curl -I http://gamerplus.org
HTTP/1.1 200 OK
Date: Mon, 13 May 2024 15:29:37 GMT
Server: Apache/2.4.52 (Ubuntu)
Content-Type: text/html; charset=UTF-8
2 Likes
LISTEN  0  511  0.0.0.0:8080  0.0.0.0:*  users:(("nginx",pid=440379,fd=6),("nginx",pid=440378,fd=6),("nginx",pid=440377,fd=6),("nginx",pid=440376,fd=6),("nginx",pid=1302,fd=6))                                                                                                                                                                                
LISTEN  0  511  0.0.0.0:443   0.0.0.0:*  users:(("nginx",pid=440379,fd=8),("nginx",pid=440378,fd=8),("nginx",pid=440377,fd=8),("nginx",pid=440376,fd=8),("nginx",pid=1302,fd=8))                                                                                                                                                                                
LISTEN  0  511     [::]:8080     [::]:*  users:(("nginx",pid=440379,fd=7),("nginx",pid=440378,fd=7),("nginx",pid=440377,fd=7),("nginx",pid=440376,fd=7),("nginx",pid=1302,fd=7))                                                                                                                                                                                
LISTEN  0  511        *:80          *:*  users:(("apache2",pid=588340,fd=4),("apache2",pid=588339,fd=4),("apache2",pid=588332,fd=4),("apache2",pid=585336,fd=4),("apache2",pid=580359,fd=4),("apache2",pid=575963,fd=4),("apache2",pid=575748,fd=4),("apache2",pid=569921,fd=4),("apache2",pid=63871,fd=4),("apache2",pid=63868,fd=4),("apache2",pid=1279,fd=4))
LISTEN  0  511     [::]:443      [::]:*  users:(("nginx",pid=440379,fd=9),("nginx",pid=440378,fd=9),("nginx",pid=440377,fd=9),("nginx",pid=440376,fd=9),("nginx",pid=1302,fd=9))

I see the apache listing.

image
Apache is definitely running.
If you are NOT using it for anything, you should just uninstall it.
Then get nginx configured to use port 80.
Then test a renewal using the LE staging environment.
Once all tests are passed, switch to LE production and obtain the cert(s).

3 Likes

I did sudo apt autoremove

and then

curl -I http://gamerplus.org
curl: (7) Failed to connect to gamerplus.org port 80 after 95 ms: Connection refused

What shows?:
sudo apt list | grep -i installed | grep -i apache

2 Likes

Thanks so much. That did it. I had no idea apache was still running without running autoremove. This is also the source of some other weirdness I've been procrastinating about.

Thanks for your assistance.

1 Like

To uninstall it, use:
sudo apt remove apache

remove - remove packages
autoremove - Remove automatically all unused packages
2 Likes

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