dongza5150 2013-07-24 12:24
浏览 79
已采纳

巨大的error_log在public_html目录中的Joomla站点填充零,导致服务器挂起

I am not sure if this is related with PHP code/Joomla plugin/component or server issue so to go and post my question at serverfault.

I have a dedicated server running CentOS release 6.4 (Final) and CPanel 11.38.1 (build 15) with [Apache/2.2.24 (Unix) PHP/5.2.17] and recently we had brute force attacks which were causing system hangs with messages like "HANG: chkservd on server". After setting up a DenyHosts and changing ssh default port the server stabilized for some days until it started to suddenly hang with no specific errors in logs nor any email notifications.

The server runs just one website but with some traffic (about 2000 visitor per day) and a large Joomla database. The site was up and running flawless since March 2013, until two weeks ago.

After investigating, I have noticed that the error_log under the public_html (default joomla site directory) size was over 200MB but with no specific error messages but just lines with date/time and zeros "0"!

[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:20] 0
[24-Jul-2013 12:09:26] 0
[24-Jul-2013 12:09:26] 0
[24-Jul-2013 12:09:30] 0

Almost every second, thousand lines like those above! Sometimes the site crashes with "jos-Error: Application Instantiation Error" and some other times with an error:

PHP Fatal error: Call to a member function get() on a non-object in ...

which is due to database issue when joomla tries to load params from the database and it fails.

I have setup a backup of the site on a local windows server machine with apache and php installed [Apache/2.2.19 (Win32) PHP/5.3.6] and these zero "0" errors also spawn on every site call with some more details in \Apache2\logs\error.log like:

[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:57 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:57 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki

thus I assume it is not server related, but Joomla site related from a plugin/component.

Also we have scanned the site with online site scanners and plain file search with antivirus tools for bot injections with no possitive results.

How we can locate what is causing these zeros as errors?

  • 写回答

1条回答 默认 最新

  • duancoubeng5909 2013-07-25 22:05
    关注

    Finally I found what is/was causing these zero errors.

    First of all, to locate what was spawning these errors I did a grep to all sites php files for the php function error_log() (http://php.net/manual/en/function.error-log.php), which writes directly the string argument message without any other information like filename, line numbers etc. At the results I saw there was an error_log(0); at a Joomla plugin that it was enabled. After opening the plugin php file, I figured out that it was my addition in order to debug something and I've had totally forgotten there. So, after deleting the line there was no more zero character errors. I don't even remember what I wanted to achieve by that call, it doesn't make any sense at all. Maybe I wanted to use error_reporting(0) to disable all errors and mistyped.

    And to make it clear, these errors were not related and responsible at all for the server crash/hang. I fixed the crashes by creating a new database and restoring the backup file, so, the old database was damaged.

    Now, after 24 hours, there was no crashes/hangs and everything works perfect again.

    EDIT:

    After some further investigation, I have realized that this error_log(0) was not my addition and it was already there when I installed the plugin! The plugin/component is Joooid, an Android client for Joomla (http://www.joooid.com). The code is located at the plg_joooidcontent inside joooidcontent.php:

    ...
    /**
     * @since   1.6
     */
    public function onContentPrepare($context, &$row, &$params, $page=0)
    {
    
        error_log(0);
        //echo "<pre>"; 
        $row ->text = $this->executeTokens($row->text);
        //print_r($row);
        //die();
    
    }
    ...
    

    Even now it is there with the latest release. I will send them a link to this question so to inform them about it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制