The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cURL Error 7 - Permission Denied?

Discussion in 'General Discussion' started by ridinhighspeeds, Sep 27, 2016.

Tags:
  1. ridinhighspeeds

    ridinhighspeeds Registered

    Joined:
    Sep 27, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MA
    cPanel Access Level:
    Root Administrator
    I have cURL SSL enabled in Apache3 and for some reason, I'm able to cURL to google.com, however I cannot cURL to http:/domain.com/test.php. I get the following error:
    CURL ERROR 7 Failed to connect to Permission denied.

    I contacted theme-fusion and they suggested whitelisting the url, but I don't see that option in WHM? I do have ConfigServer Firewall installed, however cURL still gives that error even with the firewall completely disabled?

    They recommended I apply the following change, and that didn't help either:
    [Removed URL]

    Any suggestions?
    Thanks
     
    #1 ridinhighspeeds, Sep 27, 2016
    Last edited by a moderator: Sep 27, 2016
  2. ocbox

    ocbox Member

    Joined:
    Dec 6, 2005
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Could it be because you only have http:/ and not http://
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,145
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello :),

    Might be there is an issues with the iptables OR SElinux which is enabled on your server and blocking your curl request. Check SElinux status and try to disabled it.
     
  4. ridinhighspeeds

    ridinhighspeeds Registered

    Joined:
    Sep 27, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MA
    cPanel Access Level:
    Root Administrator
    Thank you for your help. I checked my server and SElinux is disabled.. I checked my iptables, and this is what I have.. Is there a way to allow the theme-fusion url in iptables?

    Code:
    # Generated by iptables-save v1.4.7 on Thu May  1 23:26:02 2014
    *nat
    :PREROUTING ACCEPT [655:57797]
    :POSTROUTING ACCEPT [398:24677]
    :OUTPUT ACCEPT [398:24677]
    COMMIT
    # Completed on Thu May  1 23:26:02 2014
    # Generated by iptables-save v1.4.7 on Thu May  1 23:26:02 2014
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [23701:3467485]
    :acctboth - [0:0]
    :cP-Firewall-1-INPUT - [0:0]
    -A INPUT -j cP-Firewall-1-INPUT
    -A INPUT -j acctboth
    -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -p icmp -j ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
    -A INPUT -j REJECT --reject-with icmp-host-prohibited
    -A FORWARD -j cP-Firewall-1-INPUT
    -A FORWARD -j REJECT --reject-with icmp-host-prohibited
    -A OUTPUT -j acctboth
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 993 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2078 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2082 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2077 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 26 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 143 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 995 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2086 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2087 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2095 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 465 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2096 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
    -A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 2083 -j ACCEPT
    -A cP-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
    COMMIT
    # Completed on Thu May  1 23:26:02 2014
    
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,674
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You could try whitelisting the IP address utilized by that website in your CSF configuration to see if that makes a difference.

    Thank you.
     
Loading...

Share This Page