Create one configuration file per site in the directory Apache includes automatically —
/usr/local/etc/apache24/Includes/ on FreeBSD, or /etc/httpd/conf.d/ on Rocky Linux. For
example, example.com.conf:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/youruser/public_html
ErrorLog /var/log/httpd/example.com-error.log
CustomLog /var/log/httpd/example.com-access.log combined
<Directory /home/youruser/public_html>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
For each additional domain, create another file with its own ServerName, DocumentRoot,
and log paths. Apache reads every .conf file in the include directory automatically — there
is no central list to maintain. (On FreeBSD the default log location is /var/log/ with names like
httpd-example.com-access.log; adjust the paths to match your system.)
Reload Apache after adding or changing a virtual host, testing the configuration first:
# apachectl configtest && service apache24 reload # FreeBSD
# apachectl configtest && systemctl reload httpd # Rocky Linux