开发者

how to log incorrect entries (php .htaccess)

开发者 https://www.devze.com 2022-12-27 01:07 出处:网络
I have created an .htac开发者_运维问答cess files that will prevent anyone from accessing a file unless he has a username and a password, how can I log files when anyone tries to access with incorrect

I have created an .htac开发者_运维问答cess files that will prevent anyone from accessing a file unless he has a username and a password, how can I log files when anyone tries to access with incorrect information and then ban the Ip address.

I know it in php but .htaccess i am still new to it.

Thank you everyone.


You could use ErrorDocument 401 /log_request.php to send all those requests to some PHP script.

Take a look at this tutorial for more info: http://www.askapache.com/htaccess/htaccess-htpasswd-basic-auth.html

Edit: if you simply want to ban and nothing else than I would recommend using http://www.fail2ban.org/

0

精彩评论

暂无评论...
验证码 换一张
取 消