如果本文幫助到你膘格,本人不勝榮幸峭范,如果浪費了你的時間,本人深感抱歉瘪贱。
希望用最簡單的大白話來幫助那些像我一樣的人纱控。如果有什么錯誤辆毡,請一定指出,以免誤導(dǎo)大家甜害、也誤導(dǎo)我舶掖。
本文來自:http://www.reibang.com/users/320f9e8f7fc9/latest_articles
感謝您的關(guān)注。
<br />
WAMP官網(wǎng):
http://www.wampserver.com/#download-wrapper
寫在最前面:
在網(wǎng)上寫這個教程的一大片大片的尔店,之所以還要寫的原因是眨攘,我按照網(wǎng)上說的配置了,可是還是沒有成功嚣州,我也是納悶了很久鲫售,最后發(fā)現(xiàn)少了最后一步,也就是本篇的第三步避诽。所以在此留以記錄龟虎、分享。
總步驟:
- 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路徑下的 httpd.conf 文件沙庐,添加權(quán)限鲤妥;
- 修改 D:\wamp\bin\apache\apache2.4.9\conf \ 路徑下的 httpd.conf 文件,加載虛擬 hosts
- 修改 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
#======================================
#修改這幾個權(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 />