LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 04-19-2004, 10:13 PM   #1
ColoRambler
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE (8.1)
Posts: 3

Rep: Reputation: 0
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
 
Old 04-19-2004, 10:46 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
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
. Or you can deny dhcp client to change your hostname in the first place.
 
Old 04-20-2004, 10:10 PM   #3
ColoRambler
LQ Newbie
 
Registered: Apr 2004
Distribution: SuSE (8.1)
Posts: 3

Original Poster
Rep: Reputation: 0
Adding a line like that to the hosts file worked like a charm. Thanks for the tip!

ColoRambler
 
Old 04-22-2004, 12:31 PM   #4
mreyes
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
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?
 
Old 04-22-2004, 12:39 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
What does the 'hostname' command says? Does
Code:
host `hostname`
work?

Last edited by ToniT; 04-22-2004 at 01:13 PM.
 
Old 04-22-2004, 12:50 PM   #6
mreyes
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
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.
 
Old 04-22-2004, 12:59 PM   #7
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
It should. What does the hostname command says?
 
Old 04-22-2004, 01:08 PM   #8
mreyes
LQ Newbie
 
Registered: Apr 2004
Posts: 3

Rep: Reputation: 0
Hi,

the hostname command line trick worked. Thanks!
 
Old 04-25-2004, 12:49 AM   #9
Nirbo
LQ Newbie
 
Registered: Mar 2004
Location: Edmonton, Alberta, Canada
Posts: 14

Rep: Reputation: 0
Just posting to say thanks 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lilo says, "L 01 01 01" and fdisk says, "Unable to seek on /dev/hda1" clausawits Linux - General 3 12-31-2007 10:33 PM
Unable to start Apache "Cannot load /etc/httpd/modules/libphp4.so" dagalicous Linux - Software 1 03-10-2005 02:43 AM
gethostbyname("localhost") sds Linux - Networking 4 01-06-2005 06:25 AM
Apache gives [alert] mod_unique_id: unable to gethostbyname ("") kerrymwarren Linux - Networking 3 08-13-2004 06:01 PM
"unable to find usable depth" and other errors when starting X with xdm in RHL 5.2 celejar Linux - Newbie 3 03-07-2004 04:16 PM


All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration