默认首页的配置:php
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页) html
DirectoryIndex index.html index.php
web
第二种:apache服务器的配置文件./conf/httpd.conf中DirectoryIndex默认不变为index.html,此时须要当前项目下增长一个index.html文件,文件的内容以下编辑:(项目web以index.php为首页)apache
index.html文件的内容以下:服务器
网站
以上两种方式,在地址栏中输入http://localhost/web就能够直接访问到index.php的页面。ui
默认网站的配置:(项目以web为例)url
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如:.net
DocumentRoot "/usr/local/apache/htdocs/web"htm
第二种:不修改apache服务器的默认配置文件httpd.conf,而是,修改./htdocs/目录下的index.html文件:
index.html文件的内容以下:
以上两种方式,在地址栏中输入http://localhost就能够直接访问到web项目的网站。