找回密码
 注册
查看: 1045|回复: 16

apache的问题

[复制链接]
发表于 2003-12-23 14:04:39 | 显示全部楼层 |阅读模式
我开了服务了,可是无论在html那个目录里放什么文件,都是原来的那个apache的页面,到底怎么回事?
发表于 2003-12-23 14:37:28 | 显示全部楼层
更改配置文件httpd.conf中的Document指向你发布的主页目录
回复

使用道具 举报

发表于 2003-12-23 15:58:13 | 显示全部楼层
/var/www/html

把你的网页放在这个目录  是apatch默认的目录
回复

使用道具 举报

 楼主| 发表于 2003-12-24 17:47:41 | 显示全部楼层
就是啊,我是放到/var/www/html里了呀
回复

使用道具 举报

发表于 2003-12-25 09:22:51 | 显示全部楼层
能出显默认的页面说明apache已经运行了!
在redhat9中 如果把文件放到/var/www/html
就一定能行的
回复

使用道具 举报

发表于 2003-12-25 10:07:14 | 显示全部楼层
你放index.html了吗?
回复

使用道具 举报

 楼主| 发表于 2003-12-25 11:24:00 | 显示全部楼层
没有,可是我在windows下,放其他的文件也能显示的啊!
回复

使用道具 举报

发表于 2003-12-25 17:25:18 | 显示全部楼层
不同的版本设置可能不同,象我用的RPM的在welcome.conf有这样一段设置
在根下面没有找到默认的INDEX时不显示文件列表,而是转去默认页面

[email@redhat71 /tmp]$ more /etc/httpd/conf.d/welcome.conf
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

看看你的配置文件里有没有类似的设置,有的话注释掉就行了
回复

使用道具 举报

 楼主| 发表于 2003-12-25 19:59:06 | 显示全部楼层
[quote:9ca8a5a876="redhat71"]不同的版本设置可能不同,象我用的RPM的在welcome.conf有这样一段设置
在根下面没有找到默认的INDEX时不显示文件列表,而是转去默认页面

[email@redhat71 /tmp]$ more /etc/httpd/conf.d/welcome.conf
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

看看你的配置文件里有没有类似的设置,有的话注释掉就行了[/quote]
你用的是rh9下的那个吗?
回复

使用道具 举报

发表于 2003-12-26 01:19:24 | 显示全部楼层
我用的是什么不重要,重要的是你的配置文件里是否有一样或类似的设置

如果有的话可能就是这个原因,另外看看LOG,也许会有些线索
回复

使用道具 举报

发表于 2003-12-26 09:26:55 | 显示全部楼层
如果你没有放index.html,那么就必须修改你的httpd.conf里的:
...
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
《IfModule mod_dir.c》
    DirectoryIndex index.html
《/IfModule》
...
为其它样式,否则它就会自动去找里面的index.html(由于单引号不能显示,双引号你就当是单引号吧)。顺便说一句,不要万事和Windows比较,因为微软采用的许多东西是非标的,所以漏洞百出。
回复

使用道具 举报

发表于 2003-12-26 16:19:25 | 显示全部楼层
你说的这个是让APACHE识别其它的文件做默认文件,如index.php、default.php或是whatever.whatever

我觉得他现在的问题是无法对"/"直接列出autoindex生成的目录/文件列表
回复

使用道具 举报

发表于 2003-12-27 22:31:06 | 显示全部楼层
不会吧,这种问题也会有???
回复

使用道具 举报

发表于 2003-12-28 17:19:44 | 显示全部楼层
在httpd.conf指定了
DocumentRoot的值指定了你要在web上公开的文档的路径,如果不同更改子

#下面这个DirectoryIndex指定了当以目录形式提交请求时,显示的索引页面的顺序,也就是我们常常说的首页,可以有多个值,如:index.htm、index.html、index.php.甚至somegraph.jpg,apache会按照你指定的顺序来检索首页的。
DirectoryIndex index.html
回复

使用道具 举报

发表于 2003-12-29 10:32:36 | 显示全部楼层
嗯,你还应该看一看Apache的文档,搞清楚它的配置定义。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-28 21:38 , Processed in 0.044580 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表