Learn about Centmin Mod LEMP Stack today
Become a Member

Wordpress Redis cache + Opcode cache (APC/Xcache)

Discussion in 'Blogs & CMS usage' started by duydangle, Jan 18, 2016.

  1. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    I also found that php with 'centos' user works fine, but with 'root' or sudo php not found command. I had to add path to /etc/environment file to make php work with root user.

    I am using amazon ec2 and not sure they did sth with the image.

     
  2. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    oh that would explain it, depending on when you Ctrl+C you could of aborted some process during initial install.
    yeah CTRL+C could of broken PATH as centmin mod has a process to tweak it too centminmod/cpcheck.inc at 123.09beta01 · centminmod/centminmod · GitHub

    if this is a test VPS, just reload fresh CentOS 7 OS and use the new betainstaller7.sh curl install method which defaults to PHP 7.0.2 https://community.centminmod.com/posts/24267/ :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    oh several folks here have used Amazon EC2 with a few unusual problems so can't rule that out too.
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  5. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
  6. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    oh Centmin Mod does not support or use sudo for it's operation so that's another reason why !

    @duydangle does your Amazon EC2 server output any info from this below command ?

    Code:
    cat /etc/image-id
     
  7. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    could be related to EC2 default user/sudo as paths not correct for sudo node.js - On EC2: sudo node command not found, but node without sudo is ok - Stack Overflow ?

    from node.js - On EC2: sudo node command not found, but node without sudo is ok - Stack Overflow is secure_path set in /etc/sudoers ? and what's the PATH set for ?

    looks like I might need to tweak that for centmin mod missing /usr/local/bin !
    Code:
    cat /etc/sudoers | grep secure_path
    Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
     
  8. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    No I use root for all related centminmod cmds. But I have to sudo -u nginx to run php as nginx to do cron jobs. For example magento reindex cmds require php-cli.

    And there's no /etc/image-id.

    About on EC2 sudo, I think that sudo reset the PATH by using secure_path. The weird thing is even with root php is not found too.
     
  9. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    i see
    yeah looking at tweaking that out of the box soon :)
     
  10. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    see if this command sets up right PATH for sudo
    Code:
    echo "secure_path += /usr/local/bin:/usr/local/sbin" > /etc/sudoers.d/addpaths
     
  11. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    I just installed on ec2 fresh image using installer and redis doesn't work. even ccache is not found. I think this is related to the PATH of centos.

    Logs: Dropbox - centminlogs.7z
     
  12. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    after install what's output of these 3 commands
    Code:
    echo $PATH
    export PATH="/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
    echo $PATH
     
  13. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Code:
    # echo $PATH
    /usr/lib64/ccache:/sbin:/bin:/usr/sbin:/usr/bin
    # export PATH="/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
    # echo $PATH
    /usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
    #
     
  14. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    indeed strange it's only Amazon EC2 CentOS images.. what does PATH line for /root/.bashrc look like too ?
    Code:
    grep PATH /root/.bashrc
     
  15. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Code:
    export PATH="/usr/lib64/ccache:/sbin:/bin:/usr/sbin:/usr/bin"
     
  16. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Previously I tested centminmod on EC2 Centos 6 and even php is not found with root after install, php7 is compiled correctly with redis. I think I will make a fresh machine, add PATH first and run installer to see it could be fixed.
     
  17. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  18. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    About the secure_path I get errors when run sudo
    Code:
    sudo: >>> /etc/sudoers.d/addpaths: syntax error near line 1 <<<
    sudo: parse error in /etc/sudoers.d/addpaths near line 1
    sudo: no valid sudoers sources found, quitting
    sudo: unable to initialize policy plugin
     
  19. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    You have to add Defaults before secure_path +=

    It will be
    Code:
    echo "Defaults secure_path += /usr/local/bin:/usr/local/sbin" > /etc/sudoers.d/addpaths
     
  20. eva2000

    eva2000 Administrator Staff Member

    58,915
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    12:10 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+