Learn about Centmin Mod LEMP Stack today
Become a Member

Disable nginx and php caching

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Sep 28, 2016.

  1. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi :)

    How can i disable all caching methods just for some dev tests?

    nginx cache and php zend opcache plus memcache .... ?

    Thank you
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    comment out staticfiles.conf include file in nginx vhost and comment out zend opcache zend_extension=opcache.so load line in zendopcache.ini file path found from command
    Code (Text):
    php --ini

    then restart nginx and php
    Code (Text):
    nprestart

    memcached isn't used unless you web app is configured to use it
     
    • Like Like x 2
  3. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Is there any global setting for this or i should do it on every vhost file?

    staticfiles.conf
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    no global setting, if it's dev server, just move staticfiles.conf to a renamed file and setup an empty staticfiles.conf in it place - include file would do nothing then
     
    • Like Like x 1
  5. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    User enable the Wordpress log in file but he can't get any errors there but it has some 500 errors on Chrome inspect for a specific php file...

    Or i should look on another file for that errors?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
  7. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    As the ftp user can see only the domain logs at :

    Code:
    /home/nginx/domains/domain.com/log/error.log
    Is it possible to split the /var/log/php-fpm/www-php.error.log per domain and get that errors also with simple ftp access?

    That will be good for developers ...
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    nah you'd need root user access to get to read the logs right now as centmin mod isn't made for shared hosting (FAQ item 2)
     
  9. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    It is very easy to go above and read that file with the ftp solution on Centminmod :(

    But i don't want to let them know that :(
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    that's why Centmin Mod isn't for shared hosting :)

    It's for hosting your own sites and/or sites/users who you 100% trust.
     
  11. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Can i just change the log path from:

    Code:
    /home/nginx/domains/domain.com/log/
    to

    Code:
    php_admin_value[error_log] = /home/nginx/domains/domain.com/log/www-php.error.log
    And then revert it back when needed?
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    you mean change /var/log/php-fpm/www-php.error.log to /home/nginx/domains/domain.com/log/ ? i wouldn't recommend changing paths just make a copy to the directory but it is server wide and not just domain.com related so if you don't want users reading other sites not ideal
     
  13. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Ok great...

    Is there any way to adjust ftp account in the way that is not possible to go outside of the domain folder like / ?
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    pure-ftpd virtual ftp users are locked into /home/nginx/domains/domain.com and subdirectories under it. You want to block /home/nginx/domains/domain.com/log access ? if so just edit nginx vhost for domain and change the directory path to where access.log and error.logs belong i.e. /home/nginx/domains/log/domain.com/access.log etc
     
  15. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    My issue is that with a simple upload of a php file the user can go to / :(

    The user can upload a web shell php file on public folder and then browse to it from browser and then he can go to / :(

    So the user is not so locked ....
     
    Last edited: Sep 28, 2016
  16. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
  17. pamamolf

    pamamolf Well-Known Member

    2,818
    249
    63
    May 31, 2014
    Ratings:
    +443
    Local Time:
    3:19 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes i know :)

    But i was thinking that Pure ftpd had something to block that by default....
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,850
    6,905
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,396
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    nope it doesn't
     
    • Informative Informative x 1