The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Domain name bang_dba SUN Solaris 2 08-30-2008 09:41 AM
Kudda has successfully solved the downloading problems for numerous video web angelstar UNIX and Linux Applications 0 04-10-2008 05:41 AM
can this been solved with awk and sed? mskcc Shell Programming and Scripting 16 11-10-2005 11:52 AM
Xdmcp, dns, exceed broadcast solved BUT kymberm IP Networking 3 02-25-2003 09:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-09-2008
Sergiu-IT's Avatar
Registered User
 

Join Date: Mar 2005
Location: Transilvania
Posts: 131
Domain not solved from script

Hello !

I have a small problem on one of our servers - web server. From scripts (PHP and/or Perl) the domains cannot be solved to an IP address. From console everything works fine but from any sort of script the domain name cannot be solved - no matter is that domain is hosted on the same webserver or not.
Anyway, the domain is solved if I manualy put a record in /etc/hosts but this is not a solution as I don't know what domains every client accesses.

Does anybody have an ideea why is this strange behaviour ?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-09-2008
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,288
Which apache version is that ? Have you checked the log file, does HostnameLookups is set Off ? Can you show relevant part of the perl script ?
Reply With Quote
  #3 (permalink)  
Old 04-09-2008
Sergiu-IT's Avatar
Registered User
 

Join Date: Mar 2005
Location: Transilvania
Posts: 131
HostnameLookup is set to on, but the situation is the same.

In error_log I don't see anything weird, except:
shmget() failed: Cannot allocate memory
Failed to start up concurrent users module!

Is this a possible cause ?

Last edited by Sergiu-IT; 04-09-2008 at 07:37 AM..
Reply With Quote
  #4 (permalink)  
Old 04-10-2008
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,288
Is this in the apache log ? This is usually an PHP error message. Still, you haven't shown your scripts, what DNS functions are implemented ? gethostbyaddr, gethostbyname , ENV{HOSTNAME} ?
Reply With Quote
  #5 (permalink)  
Old 04-10-2008
Sergiu-IT's Avatar
Registered User
 

Join Date: Mar 2005
Location: Transilvania
Posts: 131
Quote:
Originally Posted by sysgate View Post
Is this in the apache log ? This is usually an PHP error message. Still, you haven't shown your scripts, what DNS functions are implemented ? gethostbyaddr, gethostbyname , ENV{HOSTNAME} ?
Yes, I get that in apache error_log file, but I realised that it is not connected to this error. I have a small script that I just made:

Code:
<?php
$host= "www.unix.com";
$sc  = fsockopen($host,80) or die("Error creating socket");
$out = "GET / HTTP/1.1\r\n";
$out.= "Host: $hostrn";
$out.= "Connection: Close\r\n\r\n";
fwrite($sc, $out);
fclose($sc);
?>
The error that I get in the browser is this:
Code:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/test/public_html/test.php on line 3

Warning: fsockopen() [function.fsockopen]: unable to connect to www.unix.com:80 (Unknown error) in /home/test/public_html/test.php on line 3
Error creating socket
On another server it works perfectly - the diference is that the apache version is 1.3, not 2.0.
Reply With Quote
  #6 (permalink)  
Old 04-10-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Is your apache running in a chroot?
Reply With Quote
  #7 (permalink)  
Old 04-11-2008
Sergiu-IT's Avatar
Registered User
 

Join Date: Mar 2005
Location: Transilvania
Posts: 131
No, it is not running in chroot or jail. It is a simple install.

Anyway, I solved this by downgrading to Apache 1.3. It's not what I wanted but at least now everything works fine.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 11:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66