UoL LAMP HowTo Deny Access from the Internet
Tags: UoL LAMP Server HowTo
Overview
Apache can allow or deny access based on IP address, but because the LAMP servers sit behind a Pound proxy server all the requests come from the same IP address. Pound puts the original IP address into an environment variable called X-Forwarded-For
.
This method was adapted from Deny IP Address using Setenvif.
Procedure
- Add or replace the following lines to the
Directory
element of the application in thehttp.conf
file.
<Directory ... > ... SetEnvIF X-Forwarded-For "(,| |^)143\.210\.\d{1,3}\.\d{1,3}(,| |$)" AllowIP Order deny,allow Deny from all Allow from env=AllowIP ... </Directory>
- Restart apache
Last modified
9 years ago
Last modified on 11/05/15 12:24:52
Note:
See TracWiki
for help on using the wiki.