Apache服务器配置默认首页文件名和网站路径

默认首页的配置:

     第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页) 


                        DirectoryIndex index.html index.php
                  

     第二种:apache服务器的配置文件./conf/httpd.conf中DirectoryIndex默认不变为index.html,此时需要当前项目下增加一个index.html文件,文件的内容如下编辑:(项目web以index.php为首页)

index.html文件的内容如下:

     以上两种方式,在地址栏中输入http://localhost/web就可以直接访问到index.php的页面。

默认网站的配置:(项目以web为例)

     第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如:

DocumentRoot "/usr/local/apache/htdocs/web"

     第二种:不修改apache服务器的默认配置文件httpd.conf,而是,修改./htdocs/目录下的index.html文件:

index.html文件的内容如下:

      以上两种方式,在地址栏中输入http://localhost就可以直接访问到web项目的网站。

转载请注明原文地址:http://www.server110.com/apache/201404/9487.html

你可能感兴趣的:(Apache服务器配置默认首页文件名和网站路径)