Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

under NAT server wget cronjob fail to a local url

Discussion in 'General Discussion' started by ilConfa, Jul 24, 2014.

  1. ilConfa

    ilConfa Registered

    Joined:
    Jul 24, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Guys,

    I have a big problem with the cronjob, my centos64 server is under NAT, and if I schedule a "wget" command to a local url (the url is on the same server), the command fail with timeout error,

    4623425528---PuTTY.png

    same command to an external url (but identical file) work perfectly (the url is on the other server)

    46234255282---PuTTY.png

    I think the problem is the server IP, because is not the public IP (46.234.255.28) but is the private IP, obviously I can't add public IP because this is the gateway IP address,

    46234255283---PuTTY.png

    any idea?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Have you tried adding an entry to your /etc/hosts file pointing the domain name to a local IP address to see if that makes a difference?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ilConfa

    ilConfa Registered

    Joined:
    Jul 24, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    yes I tried, but the only result is a resolution 127.0.0.1 instead of a public ip, but the timeout error persists.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you considered simply executing the file with the PHP command itself since the file is local?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. ilConfa

    ilConfa Registered

    Joined:
    Jul 24, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    yes, and it works,

    Code:
    /usr/local/bin/php -q /home/trilogy/public_html/helloworld.php
    but I thought that the error of wget could be a problem for the normal functioning of cPanel, if not, I will continue to use this method.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    It should not result in any issues with cPanel, but keep in mind that a 1:1 NAT environment is only supported if it was detected during the initial cPanel installation. You can find documentation on this here:

    1:1 NAT

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. ilConfa

    ilConfa Registered

    Joined:
    Jul 24, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    ok Michael, Thank you for support!
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice