Apache not starting properly -- "unable to gethostbyname"
Hello,
I use Linux (SuSE 8.1) on my home computer to develop a personal Web site. After a change in ISPs (I changed from DSL to a major cable provider), I've been having some difficulty getting Apache up and running. Whenever I try to start Apache, I get a message like this in the error log: [Mon Apr 19 19:37:33 2004] [alert] mod_unique_id: unable to gethostbyname("x1-6-00-03-47-39-f7-ad") and Apache doesn't start. I've noticed that this strange name ("x1-6-00-03-47-39-f7-ad") has shown up elsewhere, such as my default command line prompt, but I haven't been able to change it to something more appetizing to Apache. I've looked at httpd.conf and tried setting ServerName to 127.0.0.1 (i.e. localhost) rather than a specific host name, without any luck. I'd appreciate any advice anyone may have in resolving this. Thanks, ColoRambler |
That thing is either written to your /etc/hostname or assigned by the dhcp client.
Either way, hostname of your computer should be resolvable; there might be some problem with the domain search patch in /etc/resolv.conf. Other way to fix the problem is to put a proper line to /etc/hosts, something like Code:
127.0.0.1 nicenameyoulike localhost x1-6-00-03-47-39-f7-ad |
Adding a line like that to the hosts file worked like a charm. Thanks for the tip!
ColoRambler |
Hi, I tried that line and it worked but once I restarted the server it gave me
unable to gethostbyname("") Any ways to solve this? |
What does the 'hostname' command says? Does
Code:
host `hostname` |
Hi,
my HOSTNAME file says "debian" on it. Shouldn't that show up with the unable to gethostbyname("") error? Instead it just gives me a blank hostname. |
It should. What does the hostname command says?
|
Hi,
the hostname command line trick worked. Thanks! |
Just posting to say thanks :D This worked for me in FreeBSD 4.9-STABLE
I've never had any troubles with FreeBSD 5.2.1 and Apache 2.0.49... but this was my first runs with FreeBSD 4.9, and Apache 1.3.29 :O |
All times are GMT -5. The time now is 10:14 AM. |