apache22 won't start

Hi all,

I have just installed www/apache22 on my FreeBSD VPS (hitherto I've always ran lighttpd). For some reason, it won't start, even though the httpd.conf appears to be OK:

$ sudo /usr/local/etc/rc.d/apache22 onestart
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
/usr/local/etc/rc.d/apache22: WARNING: failed to start apache22

There is a warning in /var/log/httpd-error.log, but nothing that appears fatal:

Code:
[Wed Sep 19 13:36:57 2012] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "tilcara.localdomain"

Any ideas what might be going wrong here?

TIA
 
Make sure the hostname and IP address of the host are resolvable.
 
I have two uncommented lines in my /etc/hosts file:
Code:
::1                     localhost localhost.quilombo.nl
127.0.0.1               localhost localhost.quilombo.nl
Is this not enough?
 
Hmmm, the only way I get apache to run is to comment out mod_unique_id.so, which hardly seems ideal, but I can't seem to determine the correct hostname entry for my server, if that indeed is the problem.

Never mind, got it working. Setting the hostname in /etc/rc.conf and rebooting fixed things.
 
I had this problem too and fix it in this way:

# echo "ip-address $HOSTNAME" >> /etc/hosts

Replace ip-address before running this command.
 
Sorry for double posting. The above command is incorrect. You must run:

# echo "ip-address $HOST" >> /etc/hosts

Assume that Apache Listened on 192.168.1.3 so:

# echo "192.168.1.3 $HOST" >> /etc/hosts

You can see the complete error message in /var/log/httpd-error.log

Code:
# tail /var/log/httpd-error.log
...
[Thu Sep 20 16:06:31 2012] [alert] (EAI 8)hostname nor servname provided, or not known:
 mod_unique_id: unable to find IPv4 address of "FreeBSD"
 
Back
Top