Removing le-ssl.conf files safely

We are moving a bunch of dev sites out of the production server and I don't find a way to safely delete/remove the le-ssl.conf files created for the Apache vhosts related to the dev sites.

I remember inadvertently deleting one or doing a2dissite <sitename>-le-ssl.conf on another server and it caused some problem with Apache, so I am trying to be cautious on this production server. There's a workaround mentioned here, but it seems like a hack. I am looking for a cleaner way.

The /etc/apache2/sites-enabled and /etc/apache2/sites-available directories are littered with entries related to the le-ssl.conf files for the dev sites. For example:

root@hostname:/etc/apache2/sites-available# ls -la
total 100
drwxr-xr-x 2 root root 4096 Apr 30 02:30 .
drwxr-xr-x 8 root root 4096 Apr 30 02:30 ..
-rw-r--r-- 1 root root 1332 Jan 7 2014 000-default.conf
-rw-r--r-- 1 root root 2425 Apr 18 2017 crmdev.domain.com-le-ssl.conf
-rw-r--r-- 1 root root 6437 Jan 7 2014 default-ssl.conf
-rw-r--r-- 1 root root 2488 Oct 19 2017 feedbackdev.domain.com-le-ssl.conf
-rw-r--r-- 1 root root 2417 Jul 12 2017 invoicedev.domain.com-le-ssl.conf
-rw-r--r-- 1 root root 4548 Mar 11 21:07 invoicenew.domain.com-le-ssl.conf

a2dissite sitename.conf only removes the non-ssl config files from /etc/apache2/sites-enabled and not the le-ssl.conf ones.

Does anyone have a suggestion for a cleaner way to remove the LE config files?

Okay, I cautiously tested a2dissite on one of the le-ssl.conf files in /etc/apache2/sites-available and, to my surprise, it disabled the SSL site config without error.

So, I went ahead and repeated the process for all the SSL sites/conf files and my /etc/apache2/sites-enabled folder looks a lot cleaner now, with all the le-ssl.conf files removed.:smile:

The next step will be to check if I can delete both the non-ssl Apache config files and the le-ssl.conf files from /etc/apache2/sites-available folder for all these dev sites.

You don’t have to delete files from /sites-available/
You can just remove the links to them from /sites-enabled/

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