Want more timely Centmin Mod News Updates?
Become a Member

Xenforo APC or Memcache

Discussion in 'Forum software usage' started by KeVo, Jun 30, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that was a bug i fixed in phpmyadmin installer in /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf find HSTS header and set max-age = 0 and restart nginx and php-fpm

    Code:
    add_header Strict-Transport-Security "max-age=0; includeSubdomains;";
    or also add to /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf


    the include line for /usr/local/nginx/conf/include_opcache.conf

    edit: just updated .08 beta03 with a check for phpmyadmin addon installer's ssl vhost file /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf to insert the password proected include file /usr/local/nginx/conf/include_opcache.conf into /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf https://github.com/centminmod/centminmod/commit/3a9f5d85e0d698ef767e130b7d6d41e23c86555a
     
    Last edited: Jul 8, 2015
  2. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    10:02 PM
    Thanks adding /usr/local/nginx/conf/include_opcache.conf fixed it.

    Why is it password results are different:

    /usr/local/nginx/conf/htpasswd_opcache contents:
    result: opadmin:$randomchars.

    echo $OPPASS
    $differentrandomchars==

    2nd result/password works on OpCache stat page login prompt and the content in /usr/local/nginx/conf/htpasswd_opcache is not accepted as valid password.
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    contents of /usr/local/nginx/conf/htpasswd_opcache is encrypted text so different from echo $OPPASS which is the unencrypted password
     
  4. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    10:02 PM
    sorry to bother you again @eva2000 , all https access for opcache , memcache , phpmyadmin is no prompting password anymore. Any possible idea why? I'm just trying to make vhost_status work, created password as I don't have static ip but all of a sudden all https://IPaddress are not prompting password anymore :(
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    your https access to other areas isn't meant to work as it's a bug in phpmyadmin.

    for opcache, add to /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf the include line for /usr/local/nginx/conf/include_opcache.conf should work..

    memcache prompt is separate and within the memcache php file itself has password so that's self contained

    how did you create the vhost_status user/password protection .. post the exact commands used in CODE tags
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    @quicksalad to correct the phpmyadmin bug that mistakenly gives you https access to main hostname, edit /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf and remove the lines for root / location context and restart nginx and php-fpm and clear browser cache and restart browser

    Code:
      location / {
    
    
      }
     
  7. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    10:02 PM
  8. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    10:02 PM
    Code:
    # https SSL SPDY phpmyadmin
    server {
            listen 443 ssl spdy;
                server_name host1.mysite.com;
                root   html;
    
    keepalive_timeout  1800;
    
    client_body_buffer_size 256k;
    client_body_timeout 1800s;
    client_header_buffer_size 256k;
    ## how long a connection has to complete sending
    ## it's headers for request to be processed
    client_header_timeout  60s;
    client_max_body_size 512m;
    connection_pool_size  512;
    directio  512m;
    ignore_invalid_headers on;
    large_client_header_buffers 8 256k;
    
            ssl_certificate      /usr/local/nginx/conf/ssl/host1.mysite.com.crt;
            ssl_certificate_key  /usr/local/nginx/conf/ssl/host1.mysite.com.key;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_session_cache      shared:SSL:10m;
            ssl_session_timeout  10m;
            # mozilla recommended
            ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
            ssl_prefer_server_ciphers   on;
            add_header Alternate-Protocol  443:npn-spdy/3;
            add_header Strict-Transport-Security "max-age=0; includeSubdomains;";
            add_header X-Frame-Options SAMEORIGIN;
            spdy_headers_comp 6;
            ssl_buffer_size 1400;
            ssl_session_tickets on;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
            access_log              /var/log/nginx/localhost_ssl.access.log     main buffer=32k;
            error_log               /var/log/nginx/localhost_ssl.error.log      error;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
      location / {
    
    
      }
      include /usr/local/nginx/conf/phpmyadmin_https.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/include_opcache.conf;
    }
    Please see /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf config above
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    made a 2nd commit to phpmyadmin addon repo at fix https nav access to full main hostname · centminmod/phpmyadmin@d8bb99a · GitHub

    so @quicksalad edit /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf

    change
    Code:
      location / {
    
    
      }
    to
    Code:
        location / {
            return 302 http://$server_name$request_uri;
        }
        
    and comment out include /usr/local/nginx/conf/php.conf line

    Code:
    #include /usr/local/nginx/conf/php.conf;
    or you can uninstall phpmyadmin addon and reinstall it again

    uninstall
    Code:
    /root/tools/phpmyadmin_uninstall.sh
     
  11. CarpCharacin

    CarpCharacin Member

    267
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:32 AM
    1.15.x
    MariaDB 10.1
    So I just add that to config.php to enable libmemcached, since it is installed by default? I'm already using Zend OpCache for opcode caching.
     
  12. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    11:32 AM
    1.11.x
    10.1.18
    Yup. :)
     
  13. CarpCharacin

    CarpCharacin Member

    267
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:32 AM
    1.15.x
    MariaDB 10.1
    Awesome, thanks.
     
  14. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    11:32 AM
    1.11.x
    10.1.18
    No problem. Faster is better. ;)
     
  15. Jon Snow

    Jon Snow Active Member

    840
    170
    43
    Jun 30, 2017
    Ratings:
    +257
    Local Time:
    1:32 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    How do I check if I even have either of these installed? (APC or Memcache, not sure if Centminmod auto-installed it).
    And is this still recommended as the best option to go with in 2017?
     
  16. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    11:32 AM
    1.11.x
    10.1.18
    Centminmod auto installs memcached/libmemcached.
     
  17. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Centmin Mod defaults to Zend Opcache for PHP opcode caching instead of APC

    memcache/memcached php extensions are installed by default

    command to list loaded PHP extensions
    Code (Text):
    php -m
    

    Code (Text):
    php -m
    [PHP Modules]
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    ereg
    exif
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    mailparse
    mbstring
    mcrypt
    memcache
    memcached
    mhash
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    
     
  18. Jon Snow

    Jon Snow Active Member

    840
    170
    43
    Jun 30, 2017
    Ratings:
    +257
    Local Time:
    1:32 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    Centminmod asked if I would like to install Zend Opcache but I didn't because I was looking into this thread and several others about APC and Memcache (which I was interested in using).

    So it's just setting this up and that's it? - https://xenforo.com/help/cache/

    Should I install Zend Opcache too or does ACP make it completely obsolete for xF and WP?
     
  19. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    highly recommended to use Zend Opcache when prompted during PHP updates
     
  20. Jon Snow

    Jon Snow Active Member

    840
    170
    43
    Jun 30, 2017
    Ratings:
    +257
    Local Time:
    1:32 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    Alright. I'll install it through the centminmod menu then.

    For ACP and Memcache, I just have to follow this guide, right? - Defining a Cache | XenForo or is there more involved when it comes to configuring it?