Jump to content

[SOLVED] Block external access


T-Bird

Recommended Posts

Sorry if it's been asked a billion times, and sorry if the following doesn't make sense.  I've never done anything with apache outside of a GUI, like my webhost's control panel.

 

I'm going to be setting up a dedicated server as a fileserver for external, internet, access and I want it to hold some internal, intranet, pages for manipulating the MySQL databases that regulate the file flow.

 

Ideally I'm looking for a simple way to block all external traffic without using an authentication method.  Can I do a simple IP mass block with a whitelist and allow only traffic with the IP 192.168.x.xxx to access the subfolder holding my intranet pages?  If not is there another simple, relatively secure, way to make only a specific directory local-access only while leaving the rest of the server open to the public.

 

Again, sorry if this has been asked before, or if it's something that's exceptionally easy to do.  I know next to nothing about the workings of Apache.

 

Thanks in anticipation of the help.

Link to comment
https://forums.phpfreaks.com/topic/151018-solved-block-external-access/
Share on other sites

You can place a .htaccess file where your intranet only files are and place the following code within it

Order Allow,Deny
Allow 192.168.1

 

That will allow anyone with the internal ipaddress of 198.168.1.1 through to 198.168.1.255 access your intranet files.

 

Manual on the Allow directive

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.