好吧,全部改回来。
此更改允许访问您安装 wamp 的驱动器的根目录。不是一个好主意。S 将其改回:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
也回到
Listen 80
假设您的网站在其中,c:\wamp\www
并且如果您的子网实际上192.168.50
就像您在上面使用的那样,仅允许通过本地网络访问您的网站的简单方法是更改 httpd.conf 的这一部分
寻找
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
并更改该部分的这一部分
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
Allow from 192.168.50
该行将Allow from 192.168.50
允许从该子网上的任何 ip 访问,即 192.168.50.1 -> 192.168.255
如果您将网站放入子文件夹,请执行以下操作:
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 localhost
</Directory>
<Directory "c:\wamp\www\sitefolder">
Options Indexes FollowSymLinks
AllowOverride all
Allow from 192.168.50
</Directory>
sitefolder
这将确保您的 wampserver 主页安全,但允许本地网络中的每个人访问该站点。