Mixing Apache Authentication
Mixing PAM
Linux
How to mix PAM authentication (mod_auth_pam) and text file authentication (mod_auth) with Apache. First install this package:
Then configure your htaccess:
If mod_auth_pam doesn't find a valid user, it falls back to mod_auth authentication automatically.
Here is another example with webdav:
OpenBSD
On OpenBSD, I had to install mod_auth_bsd:
Then, enable the module for Apache:
Then restart Apache this way:
Then in the Apache configuration /var/www/conf/http.conf
, add this:
Restriction by IP address
Imagine using Jinzora. You don't want all your music to be accessible on the web. Simply add this to your VirtualHost configuration:
This will allow all the 192.168.0.0 subnet to access your website. Then reload Apache:
Restriction by htaccess
This documentation is on how to protect a directory by htaccess (login + password).
Insert these lines and adapt to your configuration (/etc/apache2/sites-enabled/000-default
):
Then create a file .htaccess
in /var/www/myhtaccess and put this:
Then create your access file with the user (/etc/apache2/htaccesspassword
):
For the next time, to add users, just remove "-c" like this:
Don't forget to restart Apache.
For a good documentation, follow this: Documentation on Htaccess
Authentication by Countries
Deny Or Allow Countries With Apache htaccess
Authentication through Radius
Here is how to authenticate through a radius server:
Radius Authentication
How To Configure Apache To Use Radius For Two-Factor Authentication On Ubuntu