View Full Version : Help with apache2
mharvey87
March 10th, 2009, 00:32
I am trying to setup apache2 without having to give it a domain name. All I have done so far was install it, no configuration.
When I start it I get the message:
httpd: apr_sockaddr_info_get() failed for
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Mon Mr 09 23:10:27 2009] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
And then when I try to test the server using my local network address in a browser the browser tells me:
Failed to Connect
Firefox can't establish a connection to the server at 192.168.2.3.
Though the site seems valid, the browser was unable to establish a connection.
Mel_Flynn
March 10th, 2009, 02:42
Can you connect to localhost?
mharvey87
March 10th, 2009, 03:07
Nope, 'connection refused'. I changed the config file so that my ip address is the domain name and did 'kldload accf_http'. Now when I start apache I get no error messages, in fact I get no message whatsoever. Still can't connect to the server.
mharvey87
March 10th, 2009, 04:56
another thing i noticed was that when i stop httpd it tells me 'httpd (no pid file) not running' as if its not even starting..
graudeejs
March 10th, 2009, 08:31
What do you expect apache to do?
You don't host any page yet....
[i haven't been using apache, I'm desktop user, but really, what do you expect it to do, when there's nothing for it to actually do?]
if you want to check if you can connect to pc simply try this [line with nc]
http://forums.freebsd.org/showpost.php?p=5965&postcount=3
[that is not apache related... but....]
gilinko
March 10th, 2009, 08:31
How do you start your apache server? Using the apachectl command or the rc script in /usr/local/etc/rc.d?
What is the output of "ps ax | grep httpd" when you have started the server?(ie does the server actually start?)
mharvey87
March 10th, 2009, 08:42
I've been using apachectl.
after 'apachectl' , 'ps ax | grep httpd' returns
4123 v0 R+ 0:00.00 grep httpd
In a linux forum I saw the following response to a similar problem:
I think that I had the same problem as you and discovered the way to fix it. Basically within /etc/default/apache2 the variable NO_START was set to 1, change this to 0 and then /etc/init.d/apache2 will create the /var/run/apache2 directory and be able to start. Hope this helps.
But I have no idea where the corresponding file to /etc/default/apache2 would be in freebsd
graudeejs
March 10th, 2009, 08:45
All installed aps and their files are in /usr/local under freebsd
so look in /usr/local/etc/apache*
there also
man find (http://www.freebsd.org/cgi/man.cgi?query=find&apropos=0&sektion=0&manpath=FreeBSD%207.1-RELEASE&format=html) which i use a lot
gilinko
March 10th, 2009, 08:52
I've been using apachectl.
after 'apachectl' , 'ps ax | grep httpd' returns
4123 v0 R+ 0:00.00 grep httpd
In a linux forum I saw the following response to a similar problem:
But I have no idea where the corresponding file to /etc/default/apache2 would be in freebsd
First of all that indicates that the server isn't started at all, so it's no surprise that you can't connect to it. Also start using the rc script instead of the apachectl program.
Edit /etc/rc.conf and set (as documented in the rc script) apache22_enable="YES", and then run /usr/local/etc/rc.d/apache22 configtest. If you get a "Syntax OK", then start the server using the same script.
mharvey87
March 10th, 2009, 08:54
thanks killa.
glinko, that doesn't work, tried it already.
gilinko
March 10th, 2009, 09:07
glinko, that doesn't work, tried it already.
Exactly what doesn't work? You do have a rc.conf file? you do have the apache22 script in the rc.d directory? you have the apacheXX_enable in your rc.conf file?
mharvey87
March 10th, 2009, 09:09
All of the above.
ale
March 10th, 2009, 09:09
What do you get running /usr/local/etc/rc.d/apache22 forcestart?
Can you see something relevant in /var/log/httpd-error.log after running the command?
mharvey87
March 10th, 2009, 09:26
Tried that, it says is starting, but when I check it's not running.
Every time I try starting it, the following error shows up int the error log. (dont know what's up with the time, its way off)
[Tue Mar 10 08:16:44 2009] [warn] Init: Session Cache is not configured [hint: SLSessionCache]
[Tue Mar 10 08:16:44 2009] [alert] (EAI 8)hostname nor servname provided, or not
known: mod_unique_id: unable to find IPv4 address of ""
Configuration Failed
ale
March 10th, 2009, 09:36
What is the output of hostname?
graudeejs
March 10th, 2009, 09:36
add
hostname="my.test.box.com"
to /etc/rc.conf
mharvey87
March 10th, 2009, 09:43
the output of host name is blank line.
I just added that to rc.conf and restarted apache, same error in the error log though
ale
March 10th, 2009, 09:45
Do you have something like 127.0.0.1 your.host.name in /etc/hosts?
mharvey87
March 10th, 2009, 09:46
yeah
ale
March 10th, 2009, 09:47
I you just added something to /etc/rc.conf, do a shutdown now, press enter when asked about the shell and type exit.
mharvey87
March 10th, 2009, 09:51
I think that worked.
mharvey87
March 10th, 2009, 09:56
http://24.21.108.146:80 Was it because I didnt have a hostname?
graudeejs
March 10th, 2009, 10:06
if you ask me, yes
[Tue Mar 10 08:16:44 2009] [alert] (EAI 8)hostname nor servname provided, or not
known: mod_unique_id: unable to find IPv4 address of ""
Configuration Failed
ale
March 10th, 2009, 10:41
http://24.21.108.146:80FreeBSD kicks ass!
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.