QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 673|回复: 2

apache的一个"奇怪错误",望高手指教!

[复制链接]
发表于 2004-6-11 07:18:25 | 显示全部楼层 |阅读模式
apache不能正确地的处理一些php或其它类型文件.
以下是telnet的一结果
[root@localhost conf]# telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /indexphp.php HTTP/1.1
Host: lazy.9966.org
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 9
Connection: Keep-Alive

Connection closed by foreign host.
不知道为什么apache会关闭连接还是系统关的?.
好像apache没处理请求就关闭连接了
而且在浏览器里是说 找不到服务器或发生 DNS 错误
在服务器删了indexphp.php又会发生404错误.
但有些php就可以
[root@localhost conf]# telnet 127.0.0.1 80
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /db.php HTTP/1.1
Host: lazy.9966.org
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 9
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Thu, 10 Jun 2004 22:51:23 GMT
Server: Apache
X-Powered-By: PHP/4.3.6
Keep-Alive: timeout=15, max=1024
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
文件权限没有问题改到777也是这样,httpd.conf应该也是没有问题的.
httpd.conf如下:
# =================================================
# Basic settings
# =================================================
ServerType standalone
ServerRoot "/usr/local/apache"
PidFile /usr/local/apache/logs/httpd.pid
ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard
ResourceConfig /dev/null
AccessConfig /dev/null

# =================================================
# Performance settings
# =================================================
Timeout 90
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 10
MaxClients 100
MaxRequestsPerChild 0

# =================================================
# Apache modules
# =================================================
ClearModuleList
AddModule mod_log_config.c
AddModule mod_mime.c
AddModule mod_dir.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_php4.c
AddModule mod_security.c

# =================================================
# General settings
# =================================================
Port 80
User nobody
Group nobody
ServerAdmin [email protected]
UseCanonicalName Off
ServerSignature Off
HostnameLookups Off
ServerTokens Prod
<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>
DocumentRoot "/www"

# =================================================
# Access control
# =================================================
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/www">
    Order allow,deny
    Allow from all
</Directory>


# =================================================
# MIME encoding
# =================================================
<IfModule mod_mime.c>
    TypesConfig /usr/local/apache/conf/mime.types
</IfModule>
DefaultType text/plain
<IfModule mod_mime.c>
    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .inc
    AddType application/x-httpd-php .class
</IfModule>

# =================================================
# Logs
# =================================================
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ErrorLog /usr/local/apache/logs/error_log
CustomLog /usr/local/apache/logs/access_log combined
ErrorDocument 404 /nofilefound.htm
ErrorDocument 500 /error.htm
# =================================================
# Virtual hosts
# =================================================
NameVirtualHost *
<VirtualHost *>
        DocumentRoot "/www"
        ServerName "lazy.9966.org"
        ServerAlias "lazy.9966.org"
        ErrorLog logs/lazy.9966.org/error_log
        CustomLog logs/lazy.9966.org/access_log combined
</VirtualHost>


# ================================================
# Logging GET/POST requests, defending against
# Cross-Site-Scripting and SQL Injection attacks
# ================================================
<IfModule mod_security.c>
        AddHandler application/x-httpd-php .php

        SecAuditEngine On
        SecAuditLog logs/audit_log
        SecFilterScanPOST On
        SecFilterEngine On

        SecFilterDefaultAction "deny,log,status:500"

        SecFilter "<(.|\n)+>"
        SecFilter "'"
        SecFilter "\""
</IfModule>
apache是在chroot下运行的.之前是可以的,是重启后过了一会发现有些php不行的(程序也是没有问题的).
apach1.3.31+php4.3.6
查看error log有exit signal File size limit exceeded
可在access log里查没有找到indexphp.php 的请求!
这到底是怎么回事呢?因为我对linux不熟希望高手们帮手解决.
小D在这谢谢了.
不想重编译安装apache跟php.去了安全模块也是这样,机子是RH linux9.0也没有用防火墙.
 楼主| 发表于 2004-6-11 09:15:28 | 显示全部楼层
http://lists.ibiblio.org/pipermail/internetworkers/2004-May/015685.html
这里有个跟我一样有exit signal File size limit exceeded 的
但我清了日志问题依久...
memory_limit 改为8也是一样.
回复

使用道具 举报

 楼主| 发表于 2004-6-11 11:55:34 | 显示全部楼层
问题已解决.
ths xlreyur,x11,mada,Chaos`Eternal,EricNeon,gEEk,KleinBlue
是要删除日志文件.不过不止是error和access.还有php的
呵呵~我一直找错了php的log file了.
原来还有个php log在chroot里的/tmp里,一直没有注意只一直的清error和access.
结果在mada的提醒下用找了下>1G的文件,结果发现/chroot里的/tmp目录下是有个大于2G的文件,删除就OK
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-8 09:53 , Processed in 0.036097 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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