I had done a lot of research before asking this question and was certain I couldn't figure it out, but I believe I did. Thanks to this guide on enabling and disabling websites, https://www.linode.com/docs/guides/how-to-enable-disable-website/, the process became a lot more clear.
It might depend on who you ask, but it looks like there isn't one that is more effective or correct than the other, and either method can be used with any distribution. The biggest difference I can see between the two lies in how websites are disabled and enabled.
The method of virtual hosting in /etc/httpd/sites-available/example.com.conf
and /etc/httpd/sites-enabled/example.com.conf
is usually used by Debian and Ubuntu distributions, but can be used by other distributions as well if it has been configured. A symlink from the /etc/httpd/sites-enabled/
directory must be made to the vhost file in /etc/httpd/sites-available/
in order to enable a website. The vhost file being /etc/httpd/sites-available/example.com.conf
The method of virtual hosting in /etc/httpd/conf.d/vhost.conf
can be used by any distribution as well. To disable a website on the Apache server, you can enter the file and add a # in front of each line in the configuration so it is not active. Or, if you are able to use a2ensite and a2dissite tools, use a2ensite example.com
to enable a website and a2dissite example.com
to disable.
There are other variations as well. I just saw one guide that directs you to configure virtual hosting in /etc/httpd/vhost.d/example.com.conf
It seems to me that you just need to choose a method, and not set up configurations in both places.