WAMP阿帕奇 - 允许本地主机 [英] Wamp Apache - Allow localhost

查看:131
本文介绍了WAMP阿帕奇 - 允许本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有类似于此的其他问题,但不回答我的问题。

There are other questions similar to this but don't answer my problem.

这是默认的的httpd.conf

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

和只允许 127.0.0.1 ,但我想也让<$ ​​C $ C>本地主机和 192.168.XX (我的私网IP)。

and it allows only 127.0.0.1, but I want to allow also localhost and 192.168.x.x (my private ip).

好了,其他的答案是:把所有主机取消注释文件中的行<$ C允许$ C> 127.0.0.1本地主机;但我读的是不安全或不reccomended。

Well, the other answers are: put Allow from all and uncomment in hosts file the line 127.0.0.1 localhost; but I read that is unsecure or not reccomended.

所以,我已经试过这样:

So I've tried this:

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.x.x
    Allow from localhost
</Directory>

它适用于 192.168.XX ,而不是本地主机(被错误: 403禁止,您没有权限访问/在此服务器上。的)

It works for 192.168.x.x, but not for localhost (gets error: 403 Forbidden, You don't have permission to access / on this server.)

1)怎样才能使它工作?

1) How can make it works?

2)可能需要在主机取消注释文件中的行 127.0.0.1本地主机

2) Maybe is required to uncomment in hosts file the line 127.0.0.1 localhost ?

3)是否真的更安全比所有允许?

3) Is it really more secure than Allow from all?

推荐答案

让我们保持它的简单,试试这个

Lets keep it simple, try this

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost 192.168 
</Directory>

:: 1是IPV6相当于127.0.0.1的

::1 is the IPV6 equivalent of 127.0.0.1

我会用四分192.168.0的第3(假设你的第三个四分位数为0)

I would use the first 3 of the quartiles 192.168.0 ( assuming your third quartile is 0 )

这篇关于WAMP阿帕奇 - 允许本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆