开发者

Can I use a .htaccess file to secure folders on my computer (using MAMP) from others on my network?

开发者 https://www.devze.com 2023-04-13 02:06 出处:网络
I have a simple question. I\'m using MAMP for development on my Mac. Once MAMP is on I access it using either localhost or 127.0.0.1. However, others can access it on my network using my IP address,

I have a simple question.

I'm using MAMP for development on my Mac. Once MAMP is on I access it using either localhost or 127.0.0.1. However, others can access it on my network using my IP address, I want to forbid this. Would anyone else even outside of my network have access when I'm connected to an internet connection?

I've put a .htaccess file in my MAMP home directory, which works as far as I've tested on other computers on the network. But how secure is this?

Thanks.开发者_如何学JAVA

Here is what I am using:

order deny,allow

deny from all

allow from 127.0.0.1


Add the following line to your httpd.conf and remove/comment out any other Listen directives:

Listen 127.0.0.1:80


Htaccess is the best way to protect your online content, but if you really want to be sure, and you're behind a router, you could simply not forward port 80, so other people won't be able to access your server. Also disabling port 80 in your firewall would help I think.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号