WAMP權(quán)限設(shè)置-Apache:You don't have permission to access / on this server.

如果本文幫助到你,本人不勝榮幸,如果浪費(fèi)了你的時(shí)間,本人深感抱歉。
希望用最簡(jiǎn)單的大白話來幫助那些像我一樣的人。如果有什么錯(cuò)誤,請(qǐng)一定指出,以免誤導(dǎo)大家、也誤導(dǎo)我。
本文來自:http://www.itdecent.cn/users/320f9e8f7fc9/latest_articles
感謝您的關(guān)注。

<br />
WAMP官網(wǎng):
http://www.wampserver.com/#download-wrapper

寫在最前面:
在網(wǎng)上寫這個(gè)教程的一大片大片的,之所以還要寫的原因是,我按照網(wǎng)上說的配置了,可是還是沒有成功,我也是納悶了很久,最后發(fā)現(xiàn)少了最后一步,也就是本篇的第三步。所以在此留以記錄、分享。

總步驟:

  1. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路徑下的 httpd.conf 文件,添加權(quán)限;
  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 文件,添加權(quán)限;

需要修改的地方,用注釋標(biāo)出,

#
# 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.
#
#======================================
#這里是我們的工作目錄,默認(rèn)是“/www”,可以自定義修改
#======================================
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>

#======================================
#在上面修改完了之后,在這里也要修改(可以不做修改,也就是使用默認(rèn)的)
#======================================
<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
    #======================================
    #修改這幾個(gè)權(quán)限
    #======================================     
</Directory>

2. 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路徑下的 httpd.conf 文件,加載虛擬 hosts

還是在剛剛的文件里, Ctrl + F 搜索 “httpd-vhosts”;
把 #Include conf/extra/httpd-vhosts.conf 的注釋放開,也就是刪除前面的 #

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

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

在 httpd-vhosts.conf 文件的最后添加以下設(shè)置。

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

然后重啟Apache就可以了。


<br />

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容