I have read the answer to this question:
https://stackoverflow.com/questions/4102763/apache-basic-authentication-except-for-those-allowed
It helped me understand how to not authenticate some users (according to the IP):
<Directory /var/www/files/>
Order deny,allow
Deny from all
Allow from 192.168.1.2
Satisfy Any
AuthUserFile /etc/apache2/basic.pwd
AuthName "Please enter username and password"
AuthType Basic
Require valid-user
</Directory>
Imagine I have this DB (Different from the DB used for authentication):
User IP
Mark 192.168.1.2
Mike 192.168.1.3
Karl 192.168.1.4
1- can I allow all the IP addresses stored in the DB using a configuration in Apache?
2- another problem is the authorization of the allowed IP is lost, can Apache use this DB for authorization, if the user is allowed to get the pages without authentication?
Update:
to be clear:
1- I don't want a static solution, I want Apache to Allow all IPs from the mentioned table in the DB ( the DB is changing dynamically).
2- We know when Apache authenticate users, it knows the user name from authentication credentials, but with the Allowing, the user name will be lost, I want Apache to extract the user name of the IP its allowing from the same table it extract the IP address?
httpd
after every change in DB). plus my DB is changing a lot@CharlieSreloading
is not good enough, this is not a good solution