web服务器中默认首页和默认网站的配置(以apache服务器为例)
2014-01-03 16:26
579 查看
默认首页的配置:
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页)
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
第二种:apache服务器的配置文件./conf/httpd.conf中DirectoryIndex默认不变为index.html,此时需要当前项目下增加一个index.html文件,文件的内容如下编辑:(项目web以index.php为首页)
index.html文件的内容如下:
<meta http-equiv="refresh" content="0; url=index.php">
以上两种方式,在地址栏中输入http://localhost/web就可以直接访问到index.php的页面。
默认网站的配置:(项目以web为例)
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如:
DocumentRoot "/usr/local/apache/htdocs/web"
<Directory "/usr/local/apache/htdocs/web">
第二种:不修改apache服务器的默认配置文件httpd.conf,而是,修改./htdocs/目录下的index.html文件:
index.html文件的内容如下:
<meta http-equiv="refresh" content="0; url=/web">
以上两种方式,在地址栏中输入http://localhost就可以直接访问到web项目的网站。
转自: http://blog.csdn.net/morgan363/article/details/4575634
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页)
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
第二种:apache服务器的配置文件./conf/httpd.conf中DirectoryIndex默认不变为index.html,此时需要当前项目下增加一个index.html文件,文件的内容如下编辑:(项目web以index.php为首页)
index.html文件的内容如下:
<meta http-equiv="refresh" content="0; url=index.php">
以上两种方式,在地址栏中输入http://localhost/web就可以直接访问到index.php的页面。
默认网站的配置:(项目以web为例)
第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如:
DocumentRoot "/usr/local/apache/htdocs/web"
<Directory "/usr/local/apache/htdocs/web">
第二种:不修改apache服务器的默认配置文件httpd.conf,而是,修改./htdocs/目录下的index.html文件:
index.html文件的内容如下:
<meta http-equiv="refresh" content="0; url=/web">
以上两种方式,在地址栏中输入http://localhost就可以直接访问到web项目的网站。
转自: http://blog.csdn.net/morgan363/article/details/4575634
相关文章推荐
- web服务器中默认首页和默认网站的配置(以apache服务器为例)
- apache 服务器修改网站默认首页
- 【Web网站服务器开发】Apache 和 Tomcat的区别及配置
- RHEL6.3配置Apache服务器(1) 配置默认Web站点
- apache中怎么配置网站的默认首页
- Ubuntu系统下搭建Redmine项目管理系统详细说明(包括配置apache服务器)(二)Web服务器apache配置
- 一个ip一个阿里云服务器配置多个网站之Apache配置
- Apache Web服务器安全配置全攻略
- Apache服务器配置默认首页文件名和网站路径
- VS 2012打开提示 未能将网站×××配置为使用 ASP.NET 4.5 和 尚未在Web服务器上注册,您需要手动将Web服务器配置为使用ASP.NET 4.5
- 配置安全的Apache WEB服务器
- vs2015启动网站调试提示 HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容。 解决方法
- Apache Web服务器安全配置全攻略
- 错误:为 Web 项目“XXX”配置的 URL“http://localhost/”的网站同时存在于本地 IIS Web 服务器和 IIS Express Web 服务器上。您需要使用 IIS 管理器在 IIS 中更改此网站的绑定。
- Ubuntu 14.04 Web服务器--Apache的安装和配置
- Apache Web服务器安全配置全攻略
- Apache服务器 配置多个网站解决方案
- Apache WEB服务器配置全攻略
- Ubuntu下配置apache的默认首页
- FreeBSD网站平台建设全过程(三、安装配置web服务器)