Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.