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
    After add addpaths I cannot sudo echo/ sudo nano anymore... Command not found... I think we should revert the addpaths as I think add Defaults will override the secure_path?

    sudo secure_path += make commands cannot run. Really weird.

     
    Last edited: Jan 21, 2016
  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+
  3. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    I think we should not touch secure_path and /etc/sudoers.d cause I remember I add /usr/local/bin in /root/.bash_rc and sudo php works. I will test this afternoon (my timezone) with /etc/environment to see if it works well.
     
  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+
    k seems this might work too in /etc/sudoers.d/addpaths
    Code:
    Defaults secure_path += /usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
     
  5. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    But you don't even need '+=', just '=' is enough for override. Why not just edit /etc/environment to make the paths work system-wide?
     
  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+
    yeah.. guess needs more testing as you obviously can tell I rarely use sudo heh

    so yeah but does work
    Code:
    Defaults secure_path = /usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
    
     
    Last edited: Jan 21, 2016
  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+
  8. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Yeh I just use the installer, and I don't know if it's because I added path fixes to /etc/environment or your new installer but redis/igbinary now compile and work correctly, as well as PHP now runs on root/sudo.
    My /etc/environment

    Code:
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
     
  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+
    ah could be a bit of each :D
     
  10. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    On my another VM (not on Amazon) running Centos 6, I downloaded the latest 09beta01 and got this error when run ./centmin.sh

    Code:
    [root@localhost centminmod]# ./centmin.sh
    ./centmin.sh: line 17: date: command not found
    ./centmin.sh: line 46: uname: command not found
    ./centmin.sh: line 66: cat: command not found
    
    /etc/resolv.conf is empty. No nameserver resolvers detected !!
    Please configure your /etc/resolv.conf correctly or you will not
    be able to use the internet or download from your server.
    aborting script... please re-run centmin.sh
    
    [root@localhost centminmod]# echo $PATH
    /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
    [root@localhost centminmod]#
    Comment the first "export PATH..." you add yesterday make the script work.
     
    Last edited: Jan 22, 2016
  11. 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+
    which one specifically ?
     
  12. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Line 2
    Code:
    export PATH="/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
     
  13. 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+
    ah it's missing a /bin path !
     
  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+
  15. 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+
    hmm looks like it screwed some routines still now
    Code:
    bash: line 51: touch: command not found
    bash: line 52: date: command not found
    bash: line 67: cd: /svr-setup: No such file or directory
    Download axel-2.5.tar.gz ...
    --2016-01-21 21:27:15--  https://github.com/eribertomota/axel/archive/2.5.tar.gz
    Resolving github.com... 192.30.252.129
    Connecting to github.com|192.30.252.129|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://codeload.github.com/eribertomota/axel/tar.gz/2.5 [following]
    --2016-01-21 21:27:15--  https://codeload.github.com/eribertomota/axel/tar.gz/2.5
    Resolving codeload.github.com... 192.30.252.162
    Connecting to codeload.github.com|192.30.252.162|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [application/x-gzip]
    Saving to: `axel-2.5.tar.gz'
    
        [ <=>                                                                                                                                                                                                             ] 56,232      --.-K/s   in 0.1s 
    
    2016-01-21 21:27:15 (404 KB/s) - `axel-2.5.tar.gz' saved [56232]
    
    Download axel-2.5.tar.gz done.
    bash: line 82: tar: command not found
    Error: axel-2.5.tar.gz extraction failed.
    Code:
    which tar touch date
    /bin/tar
    /bin/touch
    /bin/date
    seems fixing for Amazon EC2 breaks it for every other server environment LOL
     
  16. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    I just uncomment and upgrade nginx. Have not tested on a fresh machine... the PATH not correct?
     
  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+
    ah works now.. seems i pulled an outdated betainstaller.sh file for curl install it seems

    running test install now
     
  18. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Centos 6 EC2. Default user centos. "sudo -i" to switch to root.
    Install cmd:
    Code:
    curl -O [URL]https://centminmod.com/betainstaller7.sh[/URL] && chmod 0700 betainstaller7.sh && bash betainstaller7.sh
    After install got this error:
    Code:
    $ sudo -i
    -bash: uname: command not found
    -bash: [: =: unary operator expected
    -bash: ls: command not found
    # exit
    logout
    $ sudo su
    sudo: su: command not found
    
    /etc/sudoers.d/addpaths
    Code:
    Defaults secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
    Some how still missing /sbin:/bin in addpaths?
     
  19. 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+
  20. duydangle

    duydangle Member

    43
    7
    8
    May 30, 2014
    Ratings:
    +10
    Local Time:
    9:10 AM
    1.9.9
    10
    Yes it works when add /sbin:/bin