Switch to the folder:
/etc/apache2/sites-available
Open your website's configuration file, e.g. acme.org
<VirtualHost *:80> ServerAdmin webmaster@acme.org ServerName acme.org # Indexes + Directory Root. DirectoryIndex index.html DocumentRoot /var/www/acme.org # Logfiles ErrorLog /var/www/acme.org/logs/error.log CustomLog /var/www/acme.org/logs/access.log combined </VirtualHost> |
Insert the following directives:
<VirtualHost *:80> ServerAdmin webmaster@acme.org ServerName acme.org # Indexes + Directory Root. DirectoryIndex index.html DocumentRoot /var/www/acme.org
# Logfiles ErrorLog /var/www/acme.org/logs/error.log CustomLog /var/www/acme.org/logs/access.log combined </VirtualHost> |
We assume that the access to resources in the folder "mfa" requires user authentication.
Restart the Apache server: sudo service apache2 restart
Now, your website is protected by multi-factor authentication.