Questions tagged [mod-access]

Apache module which provides access control based on client hostname, IP address, or other characteristics of the client request.

The directives provided by mod_access are used in <Directory>, <Files>, and <Location> sections as well as .htaccess files to control access to particular parts of the server. Access can be controlled based on the client hostname, IP address, or other characteristics of the client request, as captured in environment variables. The Allow and Deny directives are used to specify which clients are or are not allowed access to the server, while the Order directive sets the default access state, and configures how the Allow and Deny directives interact with each other.

Both host-based access restrictions and password-based authentication may be implemented simultaneously. In that case, the Satisfy directive is used to determine how the two sets of restrictions interact.

In general, access restriction directives apply to all access methods (GET, PUT, POST, etc). This is the desired behavior in most cases. However, it is possible to restrict some methods, while leaving other methods unrestricted, by enclosing the directives in a section.

8 questions
9
votes
2 answers

Blocking multiple ip ranges using mod access in htaccess

I read the guide from apache site but I'm a bit confused, I'm trying to ban some ranges using this syntax: order allow,deny deny from 127.0.55.0/127.0.75.255 deny from 127.0.235.0/127.0.255.255 allow from all But I think it's not working properly,…
Arco
  • 103
  • 1
  • 1
  • 6
4
votes
1 answer

Translate Apache .htaccess to Lighttpd and mod_headers

I have started to use Lighttpd and I have this .htaccess file which alters the response headers. Header unset Content-Type Header unset Content-Disposition Header set Content-Disposition attachment Header set…
Loza Lowa
  • 41
  • 2
2
votes
1 answer

Using two environment variables to block access in Apache .htaccess

I'm using SetEnvIf and Deny to block access to certain countries in my .htaccess. But I need to exclude certain URLs from this blocking, and thus I'm setting another environment variable for those URLs. How do I Deny based on a combination of…
Gene Vincent
  • 5,237
  • 9
  • 50
  • 86
1
vote
1 answer

Moving to new Apache 2.4 access control syntax

I am updating my original question as I was confusing "Require not host" for the hostname contained in a referrer string. So what I need to make sure of now. In Apache 2.2 I was doing the following to allow/deny certain ip ranges, user-agents and…
MitchellK
  • 2,322
  • 1
  • 16
  • 25
1
vote
1 answer

mod_authz_host new statements for Deny directive

I was using the following in my Apache 2.1 installation: Order allow,deny Allow from all Deny from 203.XXX.YYY Deny from 10.ABC Deny from 10.CBA Deny from 10.BCA Deny from 10.ACB After updating to 2.4.7; I'm supposed to use the mod_authz_host…
hjpotter92
  • 78,589
  • 36
  • 144
  • 183
1
vote
0 answers

Silex setup fails with MAMP because mod_access.so is not found?

I have downloaded Silex and I am trying to get it running with MAMP. However, when I run Silex (and only when I run Silex), Apache won't start. In the console, I see: httpd: Syntax error on line 238 of /Applications/MAMP/conf/apache/httpd.conf:…
beth
  • 1,916
  • 4
  • 23
  • 39
1
vote
2 answers

Apache restrict access unless from localhost

The below code is in .htaccess file in /home/cuddle/test/ AuthUserFile "/home/cuddle/.htpasswds/test/passwd" AuthType Basic AuthName "Secure Area" Require valid-user This works fine, it will prompt for username & password, however when I add…
Gary Green
  • 22,045
  • 6
  • 49
  • 75
0
votes
1 answer

Denying Access to Particular IPs on Apache

One of my websites is being continuously attacked by spammers originating from a certain set of countries. There are four culprit IPs that are proving to be a nuisance. I have tried using the mod_access utility of Apache and have the following lines…