Question

removing /etc/nginx/sites-enabled/default.save

Posted November 1, 2020 170 views
Nginx

Hello,
I renewed my SSL certificate via let’s encrypt. I always could do it with the configure files that I had however this time I could not run nginx ([emerg] 4026#4026: duplicate listen options for [::]:80 in /etc/nginx/sites-enabled/default.save:31)and I found the problem is related to perhaps new nginx version that is updated by Digital Ocean automatically. I needed to remove default_server ipv6only=on from /etc/nginx/sites-enabled/default then I noticed that still I could not run nginx with the same errors. Then I noticed that I need to basically delete /etc/nginx/sites-enabled/default.save
How could I delete this file? rm: remove write-protected regular file ’/etc/nginx/sites-enabled/default.save’? y rm: cannot remove ’/etc/nginx/sites-enabled/default.save’: Permission denied
I logged in via ssh connection with keys.
By the way I could edit the file with nono and remove default_server ipv6only=onsection and now it is working fine. By the way, what exactly default_server ipv6only=on does and if one day I want to delete ’/etc/nginx/sites-enabled/default.save’ how should I get ride of permission denied? thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there @Sam80,

A file with a .save suffix is usually created when editing the original file with a text editor like nano. So it should be ok to remove the default.save file.

To do so try running the rm command with sudo so that you could delete the file:

sudo rm default.save

If this does not work, make sure to check the permissions of the file with the following command:

  • sudo ls -l /etc/nginx/sites-enabled

And also check the attributes:

  • sudo lsattr /etc/nginx/sites-enabled/default.save

Regarding the ipv6only parameter, it determines whether an IPv6 socket listening on a wildcard address [::] will accept only IPv6 connections or both IPv6 and IPv4 connections. This parameter is turned on by default. It can only be set once on start.

Let me know how it goes!
Regards,
Bobby

  • Thanks Bobby!
    As I understood you mentioned that default_server ipv6only=on should only be used once and do you mean either in /etc/nginx/sites-enabled/default or /etc/nginx/sites-enabled/default.save ?

    I want to support IPv6 too. If I add default_server ipv6only=on line to any of these two files I get the same error and nginx only starts when in both of the file s default_server ipv6only=on is deleted

    Thanks

Submit an Answer