under NAT server wget cronjob fail to a local url

ilConfa

Registered
Jul 24, 2014
4
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
Have you considered simply executing the file with the PHP command itself since the file is local?

Thank you.
 

ilConfa

Registered
Jul 24, 2014
4
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
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.