skip to Main Content

in reference to this documentation https://httpd.apache.org/docs/2.4/howto/access.html and https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html#requiredirectives , in which file should the directives be inserted? e.g. ‘Require ip 127.0.0.1’
I’m talking about configuration of apache2 in debian, I want limit access for all except for 127.0.0.1, localhost.
Thanks

2

Answers


  1. You can set the IP you wanna grant access in the configuration file of your VirtualHost (default one is on /etc/apache2/sites-avaiable/000-default.conf)

    Login or Signup to reply.
  2. ok, I solved it. the right file to enter the configuration is /etc/apache2/apache2.conf
    this is the configuration:

    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride None
    #       Require all granted
            Require host localhost
    #       Require all denied
    </Directory>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search