I am sure there is some really simple thing that I am missing or something but I have been trying to figure this out all day and don't seem to be getting anywhere. I have been trying to set up a txt file to act as a blacklist for IP address of people whom I don't want to have access to my publically available web content.
Created the file ipblacklist.txt and entered a list of IP addresses that I want to blacklist, in this format:
Code: Select all
111.222.33.44 deny
55.66.77.88 deny
192.168.0.1 allow
But now I am a bit confused. I know that I have to define the map in the vhosts config file like this:
Code: Select all
RewriteEngine On
RewriteMap access txt:/var/www/vhosts/lumaria.life/ipblacklist.txt
and then invoke the map in my .htaccess file like this:
Code: Select all
RewriteEngine On
RewriteCond ${access:%{REMOTE_ADDR}} deny [NC]
RewriteRule ^ - [L,F]
but I cant find where the damn vhosts config file on my server.
I feel like a total complete noob right now but can anyone help me out. Where exactly do I define my map, I know it is supposed to be in the vhosts config file but where is that and what is the thing called?
Really hoping someone can help me out, this is such a basic thing but I guess my brain needs a reboot or something.
Cheers
Jay