var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
I just got a new server and installed apache. I tried to start it up and get this error:
/usr/local/sbin/apachectl start: httpd could not be started
I check the httpd-error.log and this is what it says:
[Wed Mar 24 19:09:52 2004] [alert] mod_unique_id: unable to gethostbyname("")
My etc/hosts file looks like this:
::1 localhost. localhost
127.0.0.1 localhost. localhost
126.96.36.199 gower01 . gower01
188.8.131.52 gower01 . .
(fake ip address)
The hostname is set to gower01 in the rc.conf file.
The server is running FreeBSD 4.9 from SM if that helps.
Could someone please tell me what I'm doing wrong or at least point me in the right direction?
Thanks for your time
Also, I don't know if this makes a difference but when I type the command hostname, nothing shows, it is just blank. Thanks for your time.
Edit your /etc/rc.conf and set the 'hostname' field.
See the /etc/defaults/rc.conf for an example. DO NOT EDIT THE DEFAULTS FILE.
After you get that fixed you should set the "ServerName" field in your httpd.conf. If your using a ports version of apache the file can be found at /usr/local/etc/apache/httpd.conf
try setting your hostname
Run "hostname (whatever)" as root.
Then see if it will start up. If so, then probably what is going on is the reverse lookup of the interface address (the "primary one") is not coming up with a hostname when looking in /etc/hosts. Do you have two NIC cards? Maybe that is causing the problem.
There is also an apache configuration settings somewhere to override the hostname (ServerName perhaps?).
You're a genious. I did the command:
and tried to start apache and it worked. Is there a way I can get it to start up the localhost every time like that? For some reason, its not doing it automatically.
Yes edit your 'rc.conf' file like I said and the change will be set on the next reboot. What you did is only temp until you reboot.
For some reason in my rc.conf file there are 3 hostname entries in what appear to be 3 different sections:
hostname="gower01 . "
Should I just change it to:
hostname="localhost . "
I'm confused why there are three separate entries like this. On the other boxes that I've had, there have always been just one.
No you dont want to do that.
What is your full domain name for this server?
If your domain name is gower01.mydomain.com
then your 'hostname' should be set to
this entry should also match what you have in your /etc/hosts file
::1 localhost. localhost
184.108.40.206 gower01.mydomain.com gower01
220.127.116.11 gower01.mydomain.com .
Thanks for your time LTADMIN. It worked like a charm.
Not a problem.
You really should take a look at the FreeBSD handbook it has alot of step by step instructions for problems like this and other server administration tasks.