Incomming cURL being denied.

December 4, 2013 8.2k views
Hello. I've recently installed zPanel on a server of mine and incomming cURL requests are being denied, I believe this is either a PHP problem or an apache problem. Does anyone have any ideas as of to what the problem could be? Thanks!
19 Answers
Hey Samuel,

Sorry that I cannot answer your question (I know nothing about zPanel). Out of curiosity, though, why did you choose zPanel over Webmin?
^^ Answered that on my other question.

Also, I think it's more of a php/apache problem, as apposed to a zpanel problem.
Ah, cool (I hadn't noticed that you had already answered my ?).

In regard to your current predicament, have you tried:
yum install php-common
yum install php-curl


But, then again, I came across a few forum posts via Google that suggest that cURL is already installed on CentOS, but disabled by default -- and all that is needed is to uncomment ;extension=curl.so in your php.ini.
Doesn't exist in my php.ini file. :/
What version of CentOS are you using?
Did you try the first part of Pablo's answer (the one with the yum commands)?
Pablo: 6.3 I think -- it's the latest one, I know that. :)
Kamal: Yeah, I got them installed already.
incomming cURL requests are being denied

What do you mean by denied?
cURL request sent to pingrglobe.com/api -> nothing gets returned
Visits api url in browser -> data returned
Have you installed a firewall? does zPanel have a built in firewall? Have you installed mod_security and rules?
I am not sure of any of your question's answers - does this help?
http://ctrl.lesamportfolio.com/etc/apps/phpinfo/
Here's your problem:
λ ~: curl -kLI pingrglobe.com/api

HTTP/1.1 302 Found
Date: Mon, 09 Dec 2013 11:03:24 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips
Location: https://pingrglobe.com/api
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 301 Moved Permanently
Date: Mon, 09 Dec 2013 11:03:25 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips
Content-Location: api.php
Vary: negotiate
TCN: choice
Location: https://www.pingrglobe.comapi.php
Connection: close
Content-Type: text/html; charset=iso-8859-1

curl: (6) Could not resolve host: www.pingrglobe.comapi.php
Haha, I'll give it a shot as fixing.
Could any of this be my problem?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{HTTP_HOST} ^pingrglobe\.com$ [NC]
RewriteRule ^(.*)$ https://www.pingrglobe.com$1 [R=301,L]
I changed the above .htaccess and it made it pingrglobe.com/api - now I am wondering why the connection is being closed?
Seems like it's working fine now:
λ ~: curl -kLi pingrglobe.com/api

HTTP/1.1 302 Found
Date: Thu, 12 Dec 2013 11:54:39 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips
Location: https://pingrglobe.com/api
Content-Length: 330
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 301 Moved Permanently
Date: Thu, 12 Dec 2013 11:54:40 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips
Content-Location: api.php
Vary: negotiate
TCN: choice
Location: https://www.pingrglobe.com/api.php
Content-Length: 363
Connection: close
Content-Type: text/html; charset=iso-8859-1

HTTP/1.1 200 OK
Date: Thu, 12 Dec 2013 11:54:41 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips
Content-Length: 67
Connection: close
Content-Type: text/html; charset=UTF-8

{"error":"An error has occurred, but no information is available."}
Nope...
>>http://www.lesamportfolio.com/status.php
Works fine for me. Are you sure it's not working?
Have another answer? Share your knowledge.