LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1034|回复: 7

[已解决]因为FC3中的SELinux而出现httpd的DocumentRoot错误!!!

[复制链接]
发表于 2005-3-22 18:58:14 | 显示全部楼层 |阅读模式
我使用yum安装了 httpd 2.0.52-3.1。安装完成后,添加子站点的时候,填写了明明是存在的路径,可是启动httpd服务的时候,却告诉我目录不存在。怎么回事?

权限方面,我即使把该目录权限改成777也不行。

搞不懂了,请高手指教。

说明一下,我目录指向/data/www/html
其中/data是挂载的一个分区。

但是问题是,我如果将目录指向/home(同样是挂载的)就没有问题。

难道硬盘有问题?
 楼主| 发表于 2005-3-22 19:08:19 | 显示全部楼层
# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/data             /data                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/home             /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/hda7               swap                    swap    defaults        0 0
/dev/hdd                /media/cdrom            auto    pamconsole,fscontext=system_ubject_r:removable_t,ro,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,fscontext=system_ubject_r:removable_t,exec,noauto,managed 0 0
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-23 06:32:49 | 显示全部楼层
我将DocumentRoot设置为/data,启动httpd失败,说DocumentRoot必须是一个目录。
但是,如果我将挂载在上面的分区umount,再启动时就可以。

这个是怎么回事啊!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-23 07:54:07 | 显示全部楼层
下面是 /etc/httpd/conf/httpd.conf 的部分内容:
    260 #
    261 # DocumentRoot: The directory out of which you will serve your
    262 # documents. By default, all requests are taken from this directory, but    263 # symbolic links and aliases may be used to point to other locations.
    264 #
    265 #DocumentRoot "/var/www/html"
    266 DocumentRoot "/data"



# service httpd start
启动 httpd:Syntax error on line 266 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory


# ls -l /
总用量 164
drwxr-xr-x   2 root root  4096  3月 21 18:39 bin
drwxr-xr-x   3 root root  4096  3月 21 18:38 boot
drwxr-xr-x   9 root root  4096  3月 22 16:47 data


搞不懂了。这个怎么就不是目录???

然后看下面:

# umount /data/
# service httpd start
启动 httpd:httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  确定  ]

这就可以了。那是不是那个分区的磁盘有错误?还是别的原因?怎么挂载上去就不行了呢?
从来没有遇到过。请高手指点。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-23 15:45:01 | 显示全部楼层
难道无解?
回复 支持 反对

使用道具 举报

发表于 2005-3-23 16:19:15 | 显示全部楼层
用httpd -t看看结果
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-24 06:41:47 | 显示全部楼层
httpd -t 无任何输出
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-3-24 08:30:39 | 显示全部楼层
终于找到原因了。
SELinux的事情。郁闷!!!

关闭SELinux中的
强制当前:Permissive
就可以了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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