一、打开wampserver的安装目录,打开“script”文件夹,打开config.inc.php. 找到“$wwwDir = $c_installDir.'/www';”修改为$wwwDir = $c_installDir.'D:/www'; 二、打开Apache中的http.conf文件, 按住Ctrl键+F ,查找“DocumentRoot” , 修改后面的路径。 DocumentRoot "${INSTALL_DIR}/www" <Directory "${INSTALL_DIR}/www/"> 修改为 DocumentRoot "D:/www" 此时,在D盘www目录下面新建index.html测试文件 浏览器http://localhost/index.html 找不到的话 继续设置 将Apache的配置文件httpd.conf中的Include conf/extre/httpd-vhosts.conf改为#Include conf/extre/httpd-vhosts.conf # Virtual hosts 重启服务器 完活! |