免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5466 | 回复: 10

[Web] 为什么我配置的apache服务器不显示默认主页 [复制链接]

论坛徽章:
0
发表于 2006-03-09 20:22 |显示全部楼层
这几天装了apache+mysql+php
我配置httpd.conf 中 documentroot  /var/www/bugfree
这下问题来了,当我在浏览器中键入 http://192.168.0.25/
的时候,不显示主页,只显示网站目录.如果这样-->http://192.168.0.25/index.php
这样主页就可以显示出来.但以前配置的时候都是用前一种方法就可以访问.不知道这次配置哪错了.
还请各位大侠指教

论坛徽章:
0
发表于 2006-03-09 20:42 |显示全部楼层
以 CGI 方式安装
需要将以下三行加入到 Apache 的 httpd.conf 配置文件中以设定 CGI: 例子 6-5. PHP 在 Apache 2.0 中的 CGI 方式

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php

# 对 PHP 4 用这行
Action application/x-httpd-php "/php/php.exe"

# 对 PHP 5 用这行
Action application/x-httpd-php "/php/php-cgi.exe"
以 Apache 模块方式安装
需要将以下两行加入到 Apache 的 httpd.conf 配置文件中以设定 Apache 2.0 的 PHP 模块: 例子 6-6. PHP 在 Apache 2.0 中的模块方式

# 对 PHP 4 用这两行:
LoadModule php4_module "c:/php/php4apache2.dll"
# 别忘了从 sapi 目录中把 php4apache2.dll 拷贝出来!
AddType application/x-httpd-php .php

# 对 PHP 5 用这两行:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# 配置 php.ini 的路径
PHPIniDir "C:/php"

看看差了什么

论坛徽章:
0
发表于 2006-03-09 21:13 |显示全部楼层
apache 默认不去找index.php的,你需要在虚拟机和全局定义中加进去

论坛徽章:
0
发表于 2006-03-10 10:33 |显示全部楼层
我只装了Apache,怎么也找不到主页?
配置httpd.conf 中 我怎么找不到 documentroot 这个单词。
我只是把以下改了
ServerName www.localhost
屏幕始终处于opening page http://...

论坛徽章:
0
发表于 2006-03-10 13:08 |显示全部楼层
上面不是有说明:
If your host doesn't have a registered DNS name, enter its IP address here.

论坛徽章:
0
发表于 2006-03-10 23:32 |显示全部楼层
原帖由 zhshqzyc 于 2006-3-10 10:33 发表
我只装了Apache,怎么也找不到主页?
配置httpd.conf 中 我怎么找不到 documentroot 这个单词。
我只是把以下改了
ServerName www.localhost
屏幕始终处于opening page http://...


是在编辑器使用查找命令查找的吗?如果是这样请注意的大小写
  1. :/DocumentRoot
复制代码

论坛徽章:
0
发表于 2006-03-10 23:34 |显示全部楼层
原帖由 我菜我怕谁 于 2006-3-9 20:22 发表
这几天装了apache+mysql+php
我配置httpd.conf 中 documentroot  /var/www/bugfree
这下问题来了,当我在浏览器中键入 http://192.168.0.25/
的时候,不显示主页,只显示网站目录.如果这样-->[url] ...

请设定先后顺序,指定php先被访问

论坛徽章:
0
发表于 2006-03-11 12:28 |显示全部楼层
LZ好像没有认真看精华贴

论坛徽章:
0
发表于 2006-03-11 18:11 |显示全部楼层
DirectoryIndex index.html index.php index.php4


这个地方有改么!!

论坛徽章:
0
发表于 2006-03-12 11:48 |显示全部楼层
应该是DirectoryIndex指令后没有加index.php造成的.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP