1

I've been attempting to restrict access to an internet connected apache instance. My router has a port forward to the machine that is running apache. Don't know if this makes a difference.

Anyway I want to restrict it to LAN access only for the moment, and I want to use htaccess so that later I can enable visitors based on specific IPs. It is a dev server that I want my clients to be able to remotely preview, but not anyone else.

I've tried the instructions here: http://corz.org/serv/tricks/htaccess.php which explain to do this

order deny,allow
deny from all
allow from 192.168.1

In my .htaccess file, but this doesn't work, I can still access it from outside the lan. I'm trying it from my phone's 3g and it works.

If I change the order to something like

Order Deny,Allow
Deny from all
Allow from 192.168.1

(remove the comma) as per the apache docs here: http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow and the page still allows access on my phone and on the local.

Any ideas?

Jason
  • 361
  • 7
  • 19
  • Can you please post the contents of "error.log" so we can examine and pinpoint the issue? – U4iK_HaZe Aug 30 '11 at 04:23
  • Or the access log if there aren't any errors. And don't "censor" any IP addresses if/when you do post them. They are the most important bit of this problem. – Ladadadada Dec 10 '11 at 11:00

1 Answers1

1

Check if you have AllowOverride All to make sure that your .htaccess is not ignored.

quanta
  • 51,413
  • 19
  • 159
  • 217