web服务器中默认首页和默认网站的配置(以apache服务器为例)
2009-09-21 12:36
399 查看
默认首页的配置:
第一种:直接修改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项目的网站。
第一种:直接修改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项目的网站。
相关文章推荐
- web服务器中默认首页和默认网站的配置(以apache服务器为例)
- apache 服务器修改网站默认首页
- RHEL6.3配置Apache服务器(1) 配置默认Web站点
- 【Web网站服务器开发】Apache 和 Tomcat的区别及配置
- apache中怎么配置网站的默认首页
- Web 服务器的配置与应用(一) —— Apache 简介
- 在Red Hat Linux5下构建LAMP网站服务平台之编译安装Apache与配置基于域名的虚拟Web主机
- apache Web服务器资源使用限制配置
- Ubuntu下搭建Web服务器(Apache+PHP+MySQL)及初始配置
- Ubuntu 14.04 Web服务器--Apache的安装和配置
- Windows下配置Apache+Tomcat WEB服务器
- Web服务器排行:Nginx超越Apache 成为全球TOP 1000网站最常用的Web Server
- Apache Web服务器安全配置全攻略
- 个人家庭宽带搭建多域名web网站服务器配置
- Apache2.4(二) 虚拟web服务器配置
- Apache Web 服务器的安装配置方法
- ASP.NET 4.0尚未在Web服务器上注册。您需要手动将Web服务器配置为使用ASP.NET,这样您的网站才能正确运行。
- Web服务器(Apache)的配置与使用
- apache+jetty 配置web jsp服务器负载均衡
- CentOS 7中 Apache Web 服务器安装配置教程