I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite
doesn't accept multiple arguments, so I can't do
a2dissite `ls /etc/apache2/sites-enabled`
Should I use find
? Is it safe to manually delete the symlinks in /etc/apache2/sites-enabled
?
You can just do the following:
sudo a2dissite '*'
or:
sudo a2dissite
and it will prompt you for the ones you want to disable.
When you have finished disabling sites, restart apache2 server:
sudo systemctl restart apache2
or just reload apache configuration without a full restart:
sudo service apache2 reload
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With