View Full Version : Can't start Apache22
Nokobon
June 6th, 2009, 23:57
Hello,
I just installed the Apache-webserver on FreeBSD 7.1, it's version 2.2.11_4.
I added apache22_enable="YES"
to rc.conf
and uncommented
Severname 127.0.0.1:80
in httpd.conf.
I tried to start Apache:
/usr/local/etc/rc.d/apache22 start
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22
A few seconds later I get my command-line back..
but apperantly Apache isn't running on any port, as it isn't listed in the output of
sockstat -4
or
ps
And when I start the apache22 script again, it's the same procedure as described above...I don't get a warning that it's already running or something like that.
Did I forget anything trivial?
Could you tell me why my webserver isn't running?
Thanks,
Nokobon
DutchDaemon
June 7th, 2009, 00:03
Look in /var/log/httpd-error.log
Nokobon
June 7th, 2009, 00:24
Look in /var/log/httpd-error.log
There is an error:
[Sun Jun 07 01:03:52 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Jun 07 01:03:55 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "***"
Configuration Failed
By the way:
The router between the local network and ISP blocks every traffic on port 80 from the outside...
May that cause any problems even though I want to test the webserver only in the LAN first?
DutchDaemon
June 7th, 2009, 00:32
Do you have 'Listen' defined in httpd.conf?
Nokobon
June 7th, 2009, 00:35
Do you have 'Listen' defined in httpd.conf?
Yes:
Listen 80
Except for the ServerName and ServerAdmin entries it's the default configuration of httpd.conf. I dind't change anything else....
DutchDaemon
June 7th, 2009, 00:39
Nothing shown in:
ps ax | grep httpd
or
netstat -an | grep \\.80
or
sockstat -l4 | grep :80?
Nokobon
June 7th, 2009, 00:45
No...nothing, Apache isn't running.
By the way:
I use TCP-Wrapper...is this rule correct:
httpd : all : allow ?
DutchDaemon
June 7th, 2009, 00:51
That's fine.
Try this. Don't use 127.0.0.1, but the name of your server and its real IP address (something like 192.168.x.x or 10.0.x.x, whatever you have).
Make sure that that IP address is in /etc/hosts, and that it has a fully-qualified domain name (you can make one up, like box.domain.local).
Then use as ServerName box.domain.local:80. Now start Aapche.
Nokobon
June 7th, 2009, 09:29
Okay I tried both...the local Ip-address and the hostname as SeverName.
Doesn't change anything...still not startin and the same error in the log.
I forgot to mention that I use DynDNS with ddclient.
May that inhibit Apache?
I disabled ddclient in rc.conf to try apache without it.
But after a reboot ddclient is still listed under ps.
How do I really stop it?
vivek
June 7th, 2009, 10:36
Remove the following from /etc/rc.conf:
ddclient_enable="YES"
And stop existing client:
/usr/local/etc/rc.d/ddclient forcestop
Do you have host entry in /etc/hosts file for your server IP? If no dns is working httpd can use host entry from this file. A sample entry:
127.0.0.1 vivek-desktop localhost.localdomain localhost
With above 127.0.0.1 should be work with httpd.
Nokobon
June 8th, 2009, 18:10
Thank you very much for your helpful advises!
I disabled ddclient, changes my hostname to localhost.localdomain.local with sysinstall and added this to /etc/hosts:
127.0.0.1 localhost localhost.localdomain.local
After a reboot Apache started and now it works!
Thanks!
Now I will try to get ddclient working again because of my dynamic IP.
My DynDNS domain looks like myname.homeunix.net.
Am I right, that I just have to change the /etc/hosts entry to:
127.0.0.1 localhost localhost.myname.homeunix.net
?
Or does it have to look differently?
SirDice
June 8th, 2009, 18:29
Don't use localhost as a hostname. Pick something, anything you like but not localhost. If you don't have enough imagination do what I do, pick names from your favorite book.
NB Also don't use .local as a TLD. It's used by Avahi/zeroconf.
Nokobon
June 8th, 2009, 19:01
Yeah, sure. I will change the hostname (the names-from-books-idea is fine^^), and the .local-domain was for testing purpose.
Now I change it to my DynDNS-Domain.
I just wanted to know if this /etc/hosts-entry is correct and if this is all I need to do.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.