LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache DENY question (https://www.linuxquestions.org/questions/linux-software-2/apache-deny-question-169177/)

plisken 04-12-2004 11:30 AM

Apache DENY question
 
Hi all, this is the last for the day...

I've been spening the morning adding IP addresses to my httpd.conf file in the following format:

deny from 192.168 217.25

etc, etc

Now this is fine, but what I would ideally like to do is have a file full of IP addresses and simply add the entries to that, than have the config file read them, I tried the following but no such luck:

deny from < /etc/hosts.deny
(had planned to use this file for this purpose)

You get the idea of what I am trying to do, unfortunately even if there is a way to do this, then I assume I would have to restart apache for the new configuration to take place, but I suppose this can be done with cron, daily or whatever.

I plan to take IP addresses from my log files, for multiple failed attempts at password protected directories and have them added to a file, then read into the httpd.conf file as described above.

All help is appreciated, perhaps it is not possible to do as I wish in this instance.

AutOPSY 04-13-2004 12:56 AM

if you already have entries in /etc/hosts.deny, I believe apache uses this file also, cause apache can use the tcp wrappers host access control files with tcpd.

You don't need to do what you are doing, basically.

Also, why not cut and paste man, you are seriously setting yourself up for a security hole, when Apache tries to read a contorted entry like you are going to make, then not know what to do or crash or both.

plisken 04-14-2004 12:01 PM

Currently my apache config does not read the hotst.deny file, possibly I could set it up to use tcpd, but really don't know how to do such a thing.

I know you mention cut and paste, but what I really wanted to do was have a small script which would search my log file for username related errors (I am getting somewhere with this), ideally I'sd then wish to pull the associated IPs from this file and have them automatically blocked.


All times are GMT -5. The time now is 05:53 AM.