P
P
posters2020-11-21 17:54:40
Apache HTTP Server
posters, 2020-11-21 17:54:40

How to implement this through apache?

Is it possible to block access to the site for everyone, except for certain ip ranges. And for those who fit the ranges, offer to enter a login-password? Figured out how. Is it possible to do everything together?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
posters, 2020-11-21
@posters

Realized
If the IP is suitable, we display the authorization window. If not suitable, we write that access is blocked.

<If "-R '290.111.222.0/20'"> #Вот он айпишник
    AuthType Basic
    AuthName ""
    AuthUserFile .htpasswd #Нужно прописать правильный путь к файлу с логином и паролем
    Require valid-user
</If>
<Else>
    Require all denied
</Else>

A
Andrey Gavrilov, 2020-11-21
@thexaver

Can

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question