Important information:
You should edit files only in sites-available
directory.
Do never edit files inside the sites-enabled
directory, otherwise you can have problems if your editor runs out of memory or, for any reason, it receives a SIGHUP or SIGTERM.
For example: if you are using nano
to edit the file sites-enabled/default
and it runs out of memory or, for any reason, it receives a SIGHUP or SIGTERM, then nano
will create an emergency file called default.save
, inside the sites-enabled
directory. So, there will be an extra file inside the sites-enabled
directory. That will prevent Apache or NGINX to start. If your site was working, it will not be anymore. You will have a hard time until you find out, in the logs, something related to the default.save
file and, then, remove it.
In the example above, if you were editing the file inside the sites-available
directory, nothing bad would have happened. The file sites-available/default.save
would have been created, but it wouldn't do any harm inside the sites-available
directory.