Virtual Host

Create a host file

$ sudo vi /etc/apache2/sites-available/www.example.com.conf
<VirtualHost *:80>
  ServerName www.example.com
  SereverAdmin webmaster@example.com
  DocumentRoot /var/www/example
  ErrorLog /var/log/apache2/www.example.com.error.log
  CustomLog /var/log/apache2/www.example.com.custom.log combined
  <Directory /var/www/example>
    AllowOverride All
    Require all granted
  </Directory>
  Protocols h2 h2c http://1.1
</VirtualHost>

Enable configuration

$ sudo a2ensite /etc/apache2/sites-available/www.example.com.conf

Restart Apache2

$ sudo systemctl restart apache2

Last Updated on August 20, 2021 by lama-admin


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *