Apache 在局域网上共享本地主机,WAMP

Apache 在局域网上共享本地主机,WAMP,apache,localhost,wamp,Apache,Localhost,Wamp,我有一个简单的PHP项目,就是PHP和apache,我想在我的本地网络上共享这个项目,我如何才能解决这个问题 我尝试了一些在这里建立的解决方案,但无法实现 有人有什么想法吗 我已经将我的httpd.conf从apache文件夹更改为: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all </Directory> 致:

我有一个简单的PHP项目,就是PHP和apache,我想在我的本地网络上共享这个项目,我如何才能解决这个问题

我尝试了一些在这里建立的解决方案,但无法实现

有人有什么想法吗

我已经将我的httpd.conf从apache文件夹更改为:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>
致:


但是也不要工作

我们把它全部换回来

此更改允许访问安装wamp的驱动器的根目录。这不是个好主意。让我们把它改回:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
假设您的网站位于
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>
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>

#
#选项指令的可能值为“无”、“全部”,
#或以下任何组合:
#索引包括以下符号链接符号链接所有者匹配执行CGI多视图
#
#请注意,“多视图”必须显式命名为*--“所有选项”
#不给你。
#
#期权指令既复杂又重要。请看
# http://httpd.apache.org/docs/2.2/mod/core.html#options
#了解更多信息。
#
选项索引跟随符号链接
#
#AllowOverride控制可在.htaccess文件中放置的指令。
#它可以是“全部”、“无”或关键字的任意组合:
#选项FileInfo AuthConfig限制
#
允许超越所有
#
#控制谁可以从此服务器获取内容。
#
#onlineoffline标记-不删除
命令拒绝,允许
全盘否定
允许从127.0.0.1::1本地主机
选项索引跟随符号链接
允许超越所有
允许从192.168.50开始

这将使您的wampserver主页保持安全,但允许本地网络中的所有人访问
sitefolder
中的站点。

运行
ipconfig
,查看您的本地IP地址。这很可能是防火墙/网络问题。根据您的操作系统,您必须允许来自其他计算机的传入连接。因此,当您打开浏览器并输入IP时,是否会出现错误?如果是这样的话,请说明是哪一种。如果加载页面的时间过长,则是防火墙问题。
Listen 80
<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
<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>