Welcome to Centmin Mod Community
Register Now

CSF Curl and Sendy Software

Discussion in 'Other Centmin Mod Installed software' started by Chris, Sep 16, 2015.

  1. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    Last week before I upgraded php to the latest stable version, I was able to use Sendy without issue.

    This week, I'm attempting to do that, and I get a message
    Okay, I reach out to Sendy support, and they have me run a test on curl.
    I should get back a response of '200'
    I get a response of '0' it can be seen here
    phpinfo()

    I went and picked up the IP addresses for Sendy.co and AmazonSES stuff, and added them to CSF using the old command 'csf -a xx.xxx.xx.xx' no problem...but I still get this error.

    Any suggestions? Should I attempt to upgrade curl on it's own, or the forked centminmod with curl added to it?
     
    Last edited by a moderator: Sep 16, 2015
  2. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    FYI.. I removed the phpinfo file for security reasons

    reading the rest
     
    • Friendly Friendly x 1
  3. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    I doubt it's to do with curl version itself - it could be particular outgoing port being blocked so if you know the sendy outgoing port it would help

    Amazon SES has a massive amount of IP address ranges so not sure if whitelisting them all is what you have done or if it's the viable option considering it was working for you prior to PHP upgrade

    FAQ 19 on official site outlines where your log files are particularly /var/log/messages is where blocked connections may end up being logged. So you can try sending again and if blocked immediately check the /var/log/messages

    Code:
    tail -100 /var/log/messages
    you may have other legit blocked connections by CSF Firewall - CSF Firewall - CentminMod.com LEMP Nginx web stack for CentOS which is normal

    or maybe grep filter on SRC=YOURSERVERIP to narrow the output

    Code:
    tail -100 /var/log/messages | grep SRC=YOURSERVERIP
    or narrow by outgoing destination port DPT

    Code:
    tail -100 /var/log/messages | grep DPT=OUTGOINGPORT
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    btw is this the curl test script you used ?

    PHP:
    <?php
        ini_set
    ('display_errors'1);
     
        echo 
    file_get_contents_curl('https://sendy.co');
     
        
    //--------------------------------------------------------------//
        
    function file_get_contents_curl($url)
        
    //--------------------------------------------------------------//
        
    {
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_HEADER0);
            
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
            
    curl_setopt($chCURLOPT_URL$url);
            
    curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
            
    curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
            
    $data curl_exec($ch);
            return 
    'Response code: '.curl_getinfo($chCURLINFO_HTTP_CODE);
            
    curl_close($ch);
        }
    ?>
    that connects to outgoing 443 port which is opened by default on Centmin Mod recent installs /etc/csf/csf.conf TCP_OUT= line should have 443 in comma separated list. However, very old installs had it missing so double check using below command
    Code:
    grep TCP_OUT /etc/csf/csf.conf | grep --color 443
    I tested this curl script on a test PHP 5.6.13 Centmin Mod LEMP stack server and connects fine with 200 status response

    however, doesn't explain why it worked prior to PHP upgrade if it is 443 port issue on TCP_OUT
     
  6. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    Looks like 443 is opened.

    TCP_OUT = "9418,465,587,111,2049,1110,1194,9418,20,21,22,25,53,80,110,113,443,993,995"

    It's odd to me for sure. I tried on my other 2 linodes, and the same issue...
     
  7. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    I checked the license in the database, still good.

    Yes that was the script I was using.
     
  8. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    So it looks like the server is unable to make any connections out...which is weird.
    I'm thinking about just starting over, and getting rid of all SSL connections.
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    Well the test curl script worked for me. Unfortunately, I do not use sendy.co script so can't help. @BamaStangGuy and @Andy are the only folks I know using sendy.co here so not sure if they'd have any clues for you.
     
  10. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    This is beyond just sendy....I think that's just the symptoms. As I've discovered that I no longer can send emails out via mandrillapp, or reach to google analytics using DigitalPoints Better Analytics addon.
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
  12. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    I use Linode.

    Unless it IPv6 got turned on recently...via php recompile, or nginx upgrade.
     
  13. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    I'll install MTR and investigate more.
     
    • Like Like x 1
  14. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    I can't even download MTR via command line. arggggh.
     
  15. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    Try rebooting your linode and see if it fixes network connectivity first
     
  16. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    [root@localhost ~]# ping google.com
    ping: unknown host google.com

    Yeah..that didn't work, sadly.
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    what's contents of /etc/resolv.conf ?
     
  18. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    The linode in question:

    My other resolv.conf
     
  19. eva2000

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:19 PM
    Nginx 1.13.x
    MariaDB 5.5
    linode is missing valid nameservers, just having the below should be all you need

    Code:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
     
    • Useful Useful x 1
  20. Chris

    Chris Member

    33
    4
    8
    Feb 27, 2015
    Ratings:
    +6
    Local Time:
    9:19 AM
    1.7
    10
    No clue as to why that happened, but I do believe all errors in the logs now are corrected.
    Curl file:
    Response code: 200


    Thank you once again @eva2000
     
    • Like Like x 1