1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice

Outgoing HTTP Request not working

Discussion in 'Plesk for Linux - 8.x and Older' started by dbunn, Nov 26, 2005.

  1. dbunn

    dbunn Guest

    0
     
    Hi,

    I have a linux box with plesk 7.5.4 and a script that makes a http request to www.google.ca.

    The response to the http request is
    500 Can't connect to www.google.ca:80 (Bad hostname 'www.google.ca')

    The same script works on 2 other linux boxes (which do not have plesk).

    I have tried stopping the firewall and I still cannot make a successful http request.

    Can somebody help please ?

    Thanks.
     
  2. rvdmeer

    rvdmeer Guest

    0
     
    What does IPtable say?

     
  3. ShadowMan@

    ShadowMan@ Guest

    0
     
    1. Can you post the section of your script which performs the request?

    2. Can you SSH into the server and verify that you can ping 'www.google.ca'?

    3. Or do a dig to make sure your server is able to resolve the IP

    4. Is your perl version the same on the Plesk and non-Plesk servers?

    5. Is it possible that Google has blocked your IP for some reason?

    Just some things off the top of my head...
     
  4. dbunn

    dbunn Guest

    0
     
    Thanks for the feedback, below are my responses to your questions

    IPTABLES -L - cannot run this it is not recognised ? cannot find IPTABLES in path.

    1. Can you post the section of your script which performs the request?

    use HTTP::Request;
    use LWP::UserAgent;
    use CGI;

    $request = HTTP::Request->new(GET => 'http://www.google.ca');

    $ua = LWP::UserAgent->new;
    $ua->protocols_allowed( [ 'http', 'https'] );

    $response = $ua->request($request);

    $cgi = new CGI;
    print $cgi->header;
    print $response->status_line;


    2. Can you SSH into the server and verify that you can ping 'www.google.ca'?

    yes

    3. Or do a dig to make sure your server is able to resolve the IP
    did 2 so assume I do not need to do this.

    4. Is your perl version the same on the Plesk and non-Plesk servers?

    no they are different perl versions on my plesk machine it is 5.8.5, on my non-plesk machine it is 5.6.1


    5. Is it possible that Google has blocked your IP for some reason?

    I don't think so, this was just a test to see if I could make a http request from a script.
     
  5. ShadowMan@

    ShadowMan@ Guest

    0
     
    If you Google on the error, and read enough of the hits, you will see a number of other people complaining that their same/similar request scripts are now failing "after upgrading perl" on their systems.

    This leads me to think that since the perl version on your Plesk server is newer than the other 2 servers where the script works, that it may be a problem with the perl version.
     
  6. dbunn

    dbunn Guest

    0
     
    Thanks once again,

    I've tested a http request on the plesk server using php and python and they both work.

    So it does indeed look like the problem is linked to perl.

    Thanks.
     
  7. dbunn

    dbunn Guest

    0
     
    Hi,

    I have actually found out why this was not working for me.

    Selinux is installed by Fedora Core 3 (my linux box) by default.
    Once this is disabled it is possible for me to make outgoing http requests.

    For information:
    To disable Selinux, please visit http://ryandaigle.com/pebble/2005/09/27/1127827953536.html

    Thanks.
     
Loading...