Page 1 of 1

Implement Apache v2.4 Access Control in apache2.conf / httpd.conf NOT .htaccess

Posted: Sat Jul 21, 2018 7:52 am
by Bestia
On our site we want to only allow access via certain IP.

We edited :


adding the following into the directory container for the site :

Require ip

This approach and variations on it does not work.

By itself in the .htaccess, Require ip directive does work.

I ran :
apache2ctl -V | grep SERVER_CONFIG_FILE
and of course it returns /etc/apache2/apache2.conf

So, I suspect I will need to add a virtual host to the apache2.conf, but then why not do this in the domain specific VirtualHost confs?

apache2.conf also includes the conf.d dir and its config files - including vesta conf which loads the domain specific confs.

Can someone shed light on how to achieve domain specific access control in Apache 2.4 ?

Any clarifications and help would be appreciated.


I have read the docs here : ... _host.html