Renew SSL Certificate

do not edit that file, it's not supposed to be edited.

run this command: systemctl edit certbot.timer

and write there.

1 Like

this commands complete screen is black .

It's fine. It's supposed to be an empty file.

Paste this in there:

1 Like

Now also HTTP and HTTPS are accessible:

curl -Ii http://press.alwatan.com.sa
HTTP/1.1 403 Forbidden
Date: Thu, 28 Apr 2022 00:41:08 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
Accept-Ranges: bytes
Content-Length: 4897
X-XSS-Protection: 1; mode=block
Content-Type: text/html; charset=UTF-8

curl -Ii https://press.alwatan.com.sa
HTTP/1.1 200 OK
Date: Thu, 28 Apr 2022 00:41:12 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
X-Powered-By: PHP/5.4.45
X-XSS-Protection: 1; mode=block
Content-Type: text/html; charset=UTF-8
1 Like

can you please explain i dn't understand what exactly meaning of these

If you are writing to me, it means that your changes now allow access to HTTP and HTTPS - which is a good thing.

Better than before when there was no access:

You may have fixed "the problem".

1 Like

before 20 min automatic cerbot run. but still show valid till 29 May. so can you please let me know when possible certificate will renew ... still one month and 1 days remaining for expiry .

Please show:
certbot certificates

Noral renewals are set for 30 days before expiry.

1 Like

certbot certificates
The following error was encountered:
[Errno 13] Permission denied: '/var/log/letsencrypt/.certbot.lock'
Either run as root, or set --config-dir, --work-dir, and --logs-dir to writeable paths.

Please show:
sudo ps -ef | grep certbot | grep -v grep

1 Like

sudo ps -ef | grep certbot | grep -v grep
alanp 45072 32381 0 Apr27 pts/0 00:00:00 vi certbot.timer
alanp 45074 32381 0 Apr27 pts/0 00:00:00 vi certbot.timer
alanp 45078 32381 0 Apr27 pts/0 00:00:00 vi certbot.timer
alanp 45080 32381 0 Apr27 pts/0 00:00:00 vi certbot.timer
alanp 45094 32381 0 Apr27 pts/0 00:00:00 vim certbot.timer
root 45467 32381 0 Apr27 pts/0 00:00:00 sudo systemctl edit certbot.timer
root 45468 45467 0 Apr27 pts/0 00:00:00 systemctl edit certbot.timer
root 45469 45468 0 Apr27 pts/0 00:00:00 editor /etc/systemd/system/certbot.timer.d/.#override.conf76afb8c8f9b9415f

sudo certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log


Found the following certs:
Certificate Name: press.alwatan.com.sa
Domains: press.alwatan.com.sa
Expiry Date: 2022-05-29 14:40:04+00:00 (VALID: 31 days)
Certificate Path: /etc/letsencrypt/live/press.alwatan.com.sa/fullchain.pem
Private Key Path: /etc/letsencrypt/live/press.alwatan.com.sa/privkey.pem


You have four vi, one vim, two systemctl edit and one editor open ! ! !
[and possibly others]

Make time to understand how to use those editors and how to stop/kill processes you are no longer using and can't reach.

31 days left means it won't even try to renew for another day (or so).

1 Like

what to do now. if it is like this. how to close these editors. and what i need to perform to renew certificate

If you are not user alanp, then speak to them before continuing.
If you are user alanp, then you have choices:

  • kill the processed
  • switch to the terminal where you ran them and exit them properly
1 Like

Right now: nothing
Wait more than one day and rerun:
certbot certificates
to see if it renewed on its' own (as it should).

1 Like

alanp@modpress:~$
alanp@modpress:~$ sudo ps -ef | grep certbot | grep -v grep
alanp@modpress:~$
alanp@modpress:~$
alanp@modpress:~$

it is ok now. as i don't know much so i just reboot server and these edits perform by me but it was not saving.

Thu 2022-04-28 13:51:25 +03 9h left Thu 2022-04-28 03:42:14 +03 54min ago certbot.timer
so next auto run will be after 9 hours.

The next run won't do anything.

Be patient - wait until the next run after expiry date minus 30 days:

1 Like

If you do run the echo $EDITOR command that was mentioned above, you can find out which editor the OS is running when you try to edit files. Then you can find documentation about how to use that edit to edit the files, or else change the EDITOR variable to an editor that you're more familiar with.

3 Likes