logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: denial of access to server?
Author
Doug22



Joined: 02 Jun 2013
Posts: 57
Location: Houston TX

PostPosted: Tue 04 Nov '14 2:28    Post subject: denial of access to server? Reply with quote

I'm looking for how to deny an IP access to my server. Not just a particular site. I have several sites on my server. Do I need to put that denial in each and every .htaccess file? Is there some way I can specify an IP denial to everything anywhere on my server?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 05 Nov '14 10:51    Post subject: Reply with quote

In apache 2.4 the require can be set in a directory or a .htaccess file.

I recommend to put it in the directory in each vhost config.

BUT you can use Define

Code:

#global
Define BADIPS "188.40 46.4 176.9 46.166 46.21 78.46 91.207.7.21"

#vhost
    <RequireAll>
    Require all granted
    Require not ip ${BADIPS}
    </RequireAll>
Back to top


Reply to topic   Topic: denial of access to server? View previous topic :: View next topic
Post new topic   Forum Index -> Apache