Welcome to Centmin Mod Community
Register Now

reboot trouble

Discussion in 'Blogs & CMS usage' started by emre22, Dec 21, 2016.

  1. emre22

    emre22 Member

    44
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    3:37 PM
    nginx-1.10.1
    MariaDB 10
    so, how to do it on beta, I will test it first.. just hit the command:


    ./csfcf.sh nginx

    and it will do it automatically?
     
  2. eva2000

    eva2000 Administrator Staff Member

    58,909
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    11:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    add the include file outlined into your vhost above root directive first and then to test manually run
    Code (Text):
    /usr/local/src/centminmod/tools/csfcf.sh auto

    as per Beta Branch - csfcf.sh - automate Cloudflare Nginx & CSF Firewall setups | Centmin Mod Community

    that adds cloudflare ips to your csf firewall whitelist so they don't get blocked by csf + updates the include file you added with latest cloudflare ips

    example manual auto run output
    Code (Text):
    /usr/local/src/centminmod/tools/csfcf.sh auto
    
    --------------------------------------------
     Add Cloudflare IP list to CSF
     from: https://www.cloudflare.com/ips-v4/
     from: https://www.cloudflare.com/ips-v6/
    --------------------------------------------
    
    --------------------------------------------
      Add to /etc/csf/csf.allow
    --------------------------------------------
    Adding 103.21.244.0/22 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [103.21.244.0/22] to set [chain_ALLOW]
    Adding 103.22.200.0/22 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [103.22.200.0/22] to set [chain_ALLOW]
    Adding 103.31.4.0/22 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [103.31.4.0/22] to set [chain_ALLOW]
    Adding 104.16.0.0/12 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [104.16.0.0/12] to set [chain_ALLOW]
    Adding 108.162.192.0/18 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [108.162.192.0/18] to set [chain_ALLOW]
    Adding 131.0.72.0/22 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [131.0.72.0/22] to set [chain_ALLOW]
    Adding 141.101.64.0/18 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [141.101.64.0/18] to set [chain_ALLOW]
    Adding 162.158.0.0/15 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [162.158.0.0/15] to set [chain_ALLOW]
    Adding 172.64.0.0/13 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [172.64.0.0/13] to set [chain_ALLOW]
    Adding 173.245.48.0/20 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [173.245.48.0/20] to set [chain_ALLOW]
    Adding 188.114.96.0/20 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [188.114.96.0/20] to set [chain_ALLOW]
    Adding 190.93.240.0/20 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [190.93.240.0/20] to set [chain_ALLOW]
    Adding 197.234.240.0/22 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [197.234.240.0/22] to set [chain_ALLOW]
    Adding 198.41.128.0/17 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [198.41.128.0/17] to set [chain_ALLOW]
    Adding 199.27.128.0/21 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [199.27.128.0/21] to set [chain_ALLOW]
    Adding 2400:cb00::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2400:cb00::/32] to set [chain_6_ALLOW]
    Adding 2405:8100::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2405:8100::/32] to set [chain_6_ALLOW]
    Adding 2405:b500::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2405:b500::/32] to set [chain_6_ALLOW]
    Adding 2606:4700::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2606:4700::/32] to set [chain_6_ALLOW]
    Adding 2803:f800::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2803:f800::/32] to set [chain_6_ALLOW]
    Adding 2c0f:f248::/32 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2c0f:f248::/32] to set [chain_6_ALLOW]
    Adding 2a06:98c0::/29 to csf.allow and iptables ACCEPT...
    csf: IPSET adding [2a06:98c0::/29] to set [chain_6_ALLOW]
    
    created /usr/local/nginx/conf/cloudflare.conf include file
     
  3. emre22

    emre22 Member

    44
    5
    8
    Oct 15, 2016
    Ratings:
    +5
    Local Time:
    3:37 PM
    nginx-1.10.1
    MariaDB 10
    allright I uncommented

    include /usr/local/nginx/conf/cloudflare.conf;

    from my vhost configs.

    and hit that command

    /usr/local/src/centminmod/tools/csfcf.sh auto

    all sites are still running on beta box :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,909
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    11:37 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    you can confirm if it's working by checking visitor ips logged in your site's access_log at
    /home/nginx/domains/domain.com/log/access.log

    note as centmin mod nginx users a buffer cache ~256k in size for 60 seconds for writes to access_log for performance, log entries are not realtime unless you do an nginx restart which flushes writes from buffer cache to
    /home/nginx/domains/domain.com/log/access.log

    list last 10 lines of /home/nginx/domains/domain.com/log/access.log
    Code (Text):
    tail -10 /home/nginx/domains/domain.com/log/access.log


    you can browser your site first and look for log entry for your ISP ip

    if you are still getting redirected to main hostname, then it won't show up in /home/nginx/domains/domain.com/log/access.log

    have you also tried clearing browser cache, reboot your local pc before seeing if a redirect is cached in your browser ?