Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php syslog() not being logged

Discussion in 'Workarounds and Optimization' started by icishoot, Dec 25, 2016.

  1. icishoot

    icishoot Registered

    Joined:
    Jun 18, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    51
    Good morning.

    I have been trying to get the wordpress plugin WP fail2ban to work, how ever the wordpress logins are not being entered into the system logs that I can see.

    I even did a simple php file that just called the syslog() function and wasn't able to find any evidence of it being in the logs.

    Code:
    <?php
    echo "Issuing a syslog test <br />";
    syslog(LOG_ERR, "SYSLOGTEST");
    echo "Done with test";
    ?>
    
    Script echo's the strings like it should, but SYSLOGTEST does not show up in any logs.

    I'm not getting any errors in the php error logs.


    Hoping some one here has any idea as to how to fix it.

    The output from the command given in the guide to an effect thread:

    /etc/redhat-release:CentOS Linux Release 7.3.1611 (Core)
    /usr/local/cpanel/version:11.60.0.28
    /var/cpanel/envtype:xen pv
    CPANEL=release
    Server Version: Apache/2.4/23 (cPanel)
    Server Built: Dec. 13 2016 13:28:05
    ea-php-cli Copyright 2016 cPanel, Inc
    PHP 5.6.29 (cli) (built: Dec 13 2016 13:49:19)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    mysql ver 14.14 Distrib 5.6.34, for linux (x86_64) using EditLine wrapper


    things I have tried:

    edit /etc/rsyslogd.conf -> change $OmitLocalLogging from on to off

    edit /etc/rsyslog.d/listen.conf:

    Default setting for $SystemLogSocketName is /run/systemd/journal/syslog.

    When I changed it to /dev/log, the logger command successfully entered my test message into the /var/log/messages log - but the php calls to syslog() (and even error_log) still didn't do any thing.

    under the default setting of /run/systemd/journal/syslog - the logger command doesn't do any thing.



    Setj
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    There's a third-party URL here that references this WordPress plugin's use with CentOS/RHEL 7.x:

    Wordpress Fail2Ban with CentOS 7 / EL7 - Xreflow

    While the installation steps are different, you may find some of the configuration details helpful.

    Thank you.
     
Loading...

Share This Page