Having trouble starting apache

So I just installed apache, and I am new to freebsd, but I do have a good amount of Linux experience.

So I just did
Code:
/usr/ports/www/apache22
make install clean

Then I tried
Code:
/usr/local/sbin/apachectl start

And I got some error, and apache didn't start. So then I went into the config and changed the ServerName to my domain, and I try to start it again, and got some error, I didn't record it, but here is my error log
Code:
[Sat Oct 31 22:33:07 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:33:07 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:33:25 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:33:25 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:33:47 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:33:47 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:33:48 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:33:48 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:33:55 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:33:55 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:34:18 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:34:18 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:34:22 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:34:22 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:34:35 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:34:35 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:36:21 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:36:21 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:36:22 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:36:22 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:36:23 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:36:23 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:36:23 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:36:23 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:45:23 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:45:23 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:46:40 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:46:40 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:46:50 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:46:50 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:46:51 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:46:51 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:48:26 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:48:26 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed
[Sat Oct 31 22:48:34 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 31 22:48:34 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of ".local"
Configuration Failed



Now I just relogged in, and I tried
Code:
/usr/local/sbin/apachectl start
to start it, and now it's saying command not found?
I am really confused now.
 
My guess is that your configuration file has problems. Try reverting back to the one that comes during installation, or do # apachectl configtest to see what's wrong.

You seem to have some problems with the SSL and server name settings.
 
Also when I do apachectl start I get No such file or directory: Failed to enable the httpready Accelt Filter.
 
Your main problem is that you don't have a registered domain name, either in DNS or your hosts file(as can be seen from the logs). Take a closer look at the ServerName part of your configuration, and add your ip adress there(as stated by the documentation part just above.

And don't use apachectl, use the intended start/stop srcipt

Code:
/usr/local/etc/rc.d/apache22

and put this is your /etc/rc.conf file

Code:
apache22_enable="YES"
 
Still no go I tried sockstat -4
and there is nothing running on port 80

I added apache22_enable="YES"
and rebooted, still nothing.

I went back in the config, and put my wan ip, lan ip, and still nothing.
 
Does your /etc/hosts and/or /etc/rc.conf file contain any hostname related to your computers ip adress?

What does your error logs say when you put your IP in the ServerName in your httpd.conf?
 
No error comes up when I put its lan ip in the httpd.conf, and I didn't see anything related those files.

I am a bit stumped why this is happening, this is a fresh install of freebsd, basically with all the defaults... ?
 
I have the similar problem

it is my laptop installed with freebsd 7.1, and it is connected to internet by a wireless router. the IP address is configured by DHCP automaticly. and it usually is 192.168.1.100.

in my /etc/rc.conf with a line as:
Code:
hostname="freebsd"
(is it right??)

in my /usr/local/etc/apache22/http.conf:
Code:
ServerName 192.168.1.100:80

in my /boot/loader.conf with a line as:
Code:
accf_http_load="YES"

the apache22 is installed by ports with default parameters.

Code:
/usr/local/etc/rc.d/apache22 start

Code:
[~]$tail /var/log/httpd-error.log 
[Sun Nov 15 20:26:55 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Nov 15 20:26:55 2009] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "freebsd"
Configuration Failed

any sugestion?
 
Change your hostname to something like 'freebsd.domain.local', and put it in /etc/hosts as well.
 
Thanks DutchDaemon, just find your reply.

Actually I comment out the hostname=freebsd line in the rc.conf.

And comment out the
Code:
LoadModule unique_id_module libexec/apache2/mod_unique_id.so
line in httpd.conf.

Then it works, though I dont know how it happened.
 
You can fix the cause of the error, or simply remove the error, sure ...
 
I know this is a LATE answear, but the best solution would be to actually have a fully qualified domain name which is set up pointing at the servers ip, or put the local ip + the domain in /etc/hosts if youre behind NAT. Then you dont need to disable anything.
 
My Solution https://issues.apache.org/bugzilla/show_bug.cgi?id=23403
Code:
Require: /usr/ports/security/openssl/ installed
apachectl configtest // Must be a "OK"
Edit /usr/local/etc/apache22/httpd.conf file:
# Uncomment:
# Include etc/apache22/extra/httpd-ssl.conf

Edit /usr/local/etc/apache22/extra/httpd-ssl.conf:

# Uncomment and change to your domain name:
# ServerName www.my_domain.org:443

# Uncomment and change to your mail address:
# ServerAdmin webmaster@my_domain.org

And run:
cd /usr/local/openssl/certs/
/usr/local/bin/openssl genrsa -des3 -out server.key 1024
/usr/local/bin/openssl req -new -key server.key -out server.csr
cp server.key server.key.org
/usr/local/bin/openssl rsa -in server.key.org -out server.key
/usr/local/bin/openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
cp server.key /usr/local/etc/apache22/
cp server.crt /usr/local/etc/apache22/
chmod 0400 /usr/local/etc/apache22/server.key
chmod 0400 /usr/local/etc/apache22/server.crt

Restart Apache...

Configuring SSL Enabled Virtual Hosts 

SSLEngine on
SSLCertificateFile		/usr/local/etc/apache22/server.crt
SSLCertificateKeyFile	/usr/local/etc/apache22/server.key
 
DutchDaemon said:
Change your hostname to something like 'freebsd.domain.local', and put it in /etc/hosts as well.

I apologize for the "necro" but this solution solved my version of the OP's problem. I am adding this comment to help the future googlers of the world to fix the problem without excluding modules as OP did to fix his issue.
 
Add your domain name to /etc/hosts:
Code:
127.0.0.1               localhost localhost.my.domain    a.domain.local
192.168.1.32            localhost a.domain.local
 
Back
Top