I am trying to protect a folder in my directory under name admin and login from html form page. At my apache server I have edited the default-ssl.conf with following:
<Directory "/var/www/admin">
AuthFormProvider file
ErrorDocument 401 "/login.shtml"
AuthUserFile "/var/www/.htpasswd"
AuthType form
AuthName realm
AuthFormLoginRequiredLocation "https://myserver.com/login.html"
Session On
SessionCookieName session path=/
</Directory>
My passwords file is .htpasswd and my loginpage is http://myserver.com/login.html.
When I restart my apache I have following error:
AH00526: Syntax error on line 16 of /etc/apache2/sites-enabled/default-ssl.conf: Invalid command 'AuthFormProvider', perhaps misspelled or defined by a module not included in the server configuration Action 'start' failed.
Any solution for this?
The modules you'll need for this are:
a2enmod session
a2enmod session_cookie
a2enmod session_crypto
a2enmod auth_form
a2enmod request