第一步、将DocumentRoot的目录修改成项目的目录,譬如我的项目名称叫test,目录为: D:/Program Files/Apache Software Foundation/PHPWorkspace/test,那我的DocumentRoot就是:
DocumentRoot "D:/Program Files/Apache Software Foundation/PHPWorkspace/test"第二步、找到“This should be changed to whatever you set DocumentRoot to.”,将其下的<Directory设置成与DocumentRoot相同,我这里设置完成之后是这样子的:
<Directory "D:/Program Files/Apache Software Foundation/PHPWorkspace/test"> Options -Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all #指定访问顺序 DirectoryIndex index.php index.html</Directory>PS:注释代码去掉了。我这里的末尾添加了默认访问页面,也可以不加,默认回去找index.php、index.html等
注意:这两部当中涉及到的两个路径DocumentRooth和Director必须保持一致,否则会报没有权限的错误。
以上就是配置Apache服务器的默认首页的详细内容,更多请关注Vecloud其它相关文章!