热门搜索 :
考研考公
您的当前位置:首页正文

WAMP权限设置-Apache:You don't ha

来源:东饰资讯网

写在最前面:
在网上写这个教程的一大片大片的,之所以还要写的原因是,我按照网上说的配置了,可是还是没有成功,我也是纳闷了很久,最后发现少了最后一步,也就是本篇的第三步。所以在此留以记录、分享。

总步骤:

  1. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路径下的 httpd.conf 文件,添加权限;
  1. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路径下的 httpd.conf 文件,加载虚拟 hosts
  2. 修改 D:\wamp\bin\apache\apache2.4.9\conf\extra\ 路径下的 httpd-vhosts.conf ,添加工作目录

<br />


1. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路径下的 httpd.conf 文件,添加权限;

需要修改的地方,用注释标出,

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
#======================================

#======================================
DocumentRoot "E:\PHPProject"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    AllowOverride All
    Require all denied
</Directory>

#======================================
#在上面修改完了之后,在这里也要修改(可以不做修改,也就是使用默认的)
#======================================
<Directory "E:\PHPProject">
    #
    # 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.4/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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

    # onlineoffline tag - don't remove
    Require all granted
    Order Deny,Allow
    Deny from all
    Allow from all
    #======================================
    #修改这几个权限
    #======================================     
</Directory>

2. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路径下的 httpd.conf 文件,加载虚拟 hosts

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

3. 修改 D:\wamp\bin\apache\apache2.4.9\conf\extra\ 路径下的 httpd-vhosts.conf ,添加工作目录

<VirtualHost _default_:80>
#DocumentRoot "${SRVROOT}/htdocs"
DocumentRoot "E:\PHPProject"
#ServerName 
</VirtualHost>

然后重启Apache就可以了。


<br />

Top