Példa apache2 konfig

/etc/apache2/sites-enabled/sample.conf

<VirtualHost *:80> 

DocumentRoot /var/www/html 

<Directory /var/www/html> 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Require all granted 
</Directory> 

</VirtualHost>

/var/www/html/.htaccess

AuthType Basic 
AuthName "Restricted Files" 
AuthBasicProvider file 
AuthUserFile "/var/www/passwdfile" 
Require user user