# No entry for hostname (Apache)



## JasonB (Apr 11, 2009)

Hi there, I'm new to FreeBSD and Unix.

I'm using FreeBSD 7.1 and am trying to configure Apache 5.0 on my FreeBSD box. I keep getting this error in /var/log/httpd-error.log

mod_unique_id: unable to gethostbyname("")


and am unable to get Apache to start. I sort of understand the group of files this error deals with, but I don't understand why I'm getting no paramaters in gethostbyname().


typing in ]$ hostname 

comes up empty also


I'm just setting up this server for use with machines on my local network, so I don't have a domain to enter, and have been using my local network IP address in all the configuration files.

Anyway, any human input on this might stop me from going premature grey. 

Thanks


----------



## joel@ (Apr 11, 2009)

Put:

```
hostname="your.domain.here"
```
into /etc/rc.conf and reboot.


----------



## Android1 (Apr 11, 2009)

Sysinstall can be also be used for this task. Go to Configure âˆ’âˆ’> Networking âˆ’âˆ’>Interfaces âˆ’âˆ’> "your NIC".


----------



## MG (Apr 11, 2009)

Does a ping to the hostname work?
You might need to add a hostname reference to the ip of the httpd server in /etc/hosts like

192.168.0.1         myserver   myserver.my.domain


----------



## JasonB (Apr 11, 2009)

joel@ said:
			
		

> Put:
> 
> ```
> hostname="your.domain.here"
> ...





Thanks, this fixed it.

I had the /etc/rc.conf  entry as

hostmame="192.xxx.x.x"

But forgot to reboot the machine.

After reboot this morning, Apache was up and running. Thanks for everyone's help.


----------

