On Ubuntu 22.02
. all apache config files are exist under available
directory and you need to enable them by running a2ensite 000-default.conf
/etc/apache2/sites-available/000-default.conf
--------------------------
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Permissions settings
<Directory /var/www/html>
# Allow access to the directory and its content
Options Indexes FollowSymLinks
AllowOverride All
# Allow only certain methods for security
Require all granted
</Directory>
</VirtualHost>
For subdomains