I would like to restrict access to a folder according to some IPs.
I already know how to do that by
<Directory "/path/to/my/directory/">
Order Deny,Allow
Deny from all
Allow from 123.123.123.1 # IP 1
Allow from 123.123.123.2 # IP 2
Allow from 127
</Directory>
As I would like to manage the list of allowed IP differently, I would prefer allow them from a text file where the IPs could be notes like that :
123.123.123.1
123.123.123.2
Does anybody know how to do that ? If that's not possible is there another way to do such thing ?
P.S.: To make everything clear, my final purpose is to grab IPs connected to a local VPN (OpenVPN), complete a file with the IP if not already include and restart apache2 so that it can take account of them. It's a little bit strange but on the same server i have html contents that I wanna be accessed only by vpn users. But even if I pass through the vpn, apache2 see the remote IP address not the endpoint one...