LinuxSir.cn,穿越时空的Linuxsir!

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

apache 问题

[复制链接]
发表于 2004-12-16 10:42:54 | 显示全部楼层 |阅读模式
[root@host ~]$ /etc/init.d/httpd start
启动 httpd:(13)Permission denied: httpd: could not open error log file /etc/httpd/logs/error_log.
Unable to open logs
                                                       失败

  之前是没有error_log这个文件的,我也不知道为什么会没有这个文件,后来我创建了一个error_log, 就出现了以上的问题,apache启动不了。怎办??
发表于 2004-12-16 11:02:15 | 显示全部楼层
you might use root created that file, but when apache starts, it trys to start as 'apache' user which is not able to write to that file. you can either delete it or change the permission on that file.
 楼主| 发表于 2004-12-16 16:17:23 | 显示全部楼层
问题还没有解决! 真不明白, error_log的权限任何用户都有了,还不行,我再找一下原因。
 楼主| 发表于 2004-12-16 16:51:22 | 显示全部楼层
httpd (Apache web server) is not running or cannot be started due to a out-of-space problem. The following error message is seen in /var/log/appliance-setup.log:

Waiting for tomcat to initialize...

........Starting httpd:fopen:No space left on device

httpd:could not open error log file /etc/httpd/logs/error_log.

[FAILED]

There are many (thousands) mgetty.log files generated in the /var/log directory. This large number of log files uses up all file system resources and the file system is not able to accommodate any more new file. Once the log files are removed, the system can function normally.

After inspecting the logrotate configuration file (/etc/logrotate.d/mgetty) that comes with mgetty, it was found that there is a mis-configuration in the file:

/var/log/mgetty.log.tty* {
       nocompress
       missingok
}

The wide-card asterisk commands logrotate to rotate not only the mgetty.log.ttyS0 file, but all the files that are created in each of the subsequent rotation. Eventually, all the file system resources are used up.

This is a two-step workaround:

First, remove existing mgetty log files with the command:
find /var/log -name 'mgetty.log.ttyS0.*' -print | xargs rm -fr

Second, correct the mgetty logrotate configuration (/etc/logrotate.d/mgetty) as follows:

/var/log/mgetty.log.ttyS0 {
       nocompress
       missingok
}
发表于 2004-12-19 20:24:05 | 显示全部楼层
No space left on device

httpd:could not open error log file /etc/httpd/logs/error_log.

???空间或权限?
发表于 2004-12-19 21:10:59 | 显示全部楼层
空间不足,删除LOG文件。没有足够空间touch LOG文件了。
#find /var/log -name 'mgetty.log.ttyS0.*' -print | xargs rm -fr
配置一下这个文件etc/logrotate.d/mgetty
加入这些:
/var/log/mgetty.log.ttyS0 {
nocompress
missingok
}
发表于 2004-12-19 21:16:50 | 显示全部楼层
/etc/httpd/logs/error_log !!
默认的error_log的位置应该是/var/log/httpd/error_log
默认是没有 /etc/httpd/logs的目录你当然写不进去!
看看httpd.conf文件中是如何定义error_log的,可能错在这了!
发表于 2004-12-19 22:32:12 | 显示全部楼层
一、df -H查看各个磁盘空间
二、把你的httpd.conf贴出来看一下

问:
配置一下这个文件etc/logrotate.d/mgetty
这是个什么文件,干什么用的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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