S
S
Stanislav Smirnov2016-01-05 11:46:08
Apache HTTP Server
Stanislav Smirnov, 2016-01-05 11:46:08

How to deny everyone and allow specific ip access to apache virtual host?

There is a machine with a web. service on apache2 debian. It is required to deny access to the service "for everyone except". These settings can also be made through .htaccess, but this option is not suitable.
It requires configuration through /etc/apache2/sites-available.
It is necessary to close the resource on 127.0.0.1 for complete isolation of the virtual host and allow access to a specific ip to access the resource from the network. What parameters need to be entered to implement the task.
Apache version 2.4

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim K, 2016-01-05
@OLQLOSH

In apache 2.2 use the directives:
Order Deny,Allow
Deny from all
Allow from 1.2.3.4
In apache 2.4 it's a little different. We replace:
Deny from all with Require all denied
Allow from 1.2.3.4 with Require ip 1.2.3.4
Information on this issue in Google is a wagon and two carts. I don't think it's hard to figure it out.

R
Robot, 2016-01-05
@iam_not_a_robot

iptables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question