Results 1 to 5 of 5

Thread: How to make Apache look at /etc/hosts.deny?

  1. #1
    Join Date
    Feb 2007
    Beans
    395
    Distro
    Ubuntu 12.04 Precise Pangolin

    How to make Apache look at /etc/hosts.deny?

    I just beefed up security on my home Linux box so that brute force attacks on sshd are auto blocked (IPs are added to hosts.deny by the 'denyhosts' service). However, even putting "ALL: w.x.y.z" into hosts.deny doesn't prevent them from going to my Apache server. I suppose it's because Apache runs as a separate process, outside the TCP wrapper.

    How do I make Apache2 use hosts.deny/hosts.allow? (I just did the basic install of Apache via apt-get install apache2)

    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    8,444

    Re: How to make Apache look at /etc/hosts.deny?

    I believe you need to compile Apache with Libwrap support.

  3. #3
    Join Date
    Feb 2007
    Beans
    395
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to make Apache look at /etc/hosts.deny?

    Ah well, I guess that's out! I'm not really one for compiling stuff, I really prefer using apt-get to install things. It's not that important to me anyway. Was just curious if there was another way.

  4. #4
    Join Date
    Oct 2006
    Location
    SLC, UofU
    Beans
    684
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: How to make Apache look at /etc/hosts.deny?

    It is much easier to include in your Apache Allow/Deny directives, and I don't think it would be too difficult to generate a dynamic .htaccess file from your hosts.deny file. I may give it a try, if it works I'll let you know how I did it.

    Best of Luck
    --Superb--

  5. #5
    Join Date
    Apr 2008
    Beans
    7

    Re: How to make Apache look at /etc/hosts.deny?

    As wirlessmonkey said check how to use proper authentication or allow/deny directives from within the apache2.conf. You can set them by IP or allow authenticated and generate .htaccess user credentials.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •