How to enable all site confs with a2ensite (while passing over 000-default.conf && default-ssl.conf)?

Might aswell just use find on your config directory.

find /etc/apache2/sites-available/ -type f -and -not -name "*default*" -exec a2ensite {} \;

This finds all your configuration files that are not having "default" in their name and activates them.


You need to navigate to /etc/apache2/sites-available and then run the command:

sudo a2ensite *

It will enable all sites in the directory. (the files should be somthing like xxx.conf)

And then reload apache using sudo service apache2 reload.

So your command sequence should be like so:

cd /etc/apache2/sites-available
sudo a2ensite *
sudo service apache2 reload