Apache: Failed to enable the 'httpready' Accept Filter

hurricane_sh

Member


Messages: 43

#1
Made a minor upgrade from Apache 2.2.19 to 2.2.21, then I always get the following error message when start Apache.

Code:
[warn] (22)Invalid argument: Failed to enable the 'httpready' Accept Filter
In the previous version I eliminated the above error with kldload, unfortunately it no longer works, any ideas?

Code:
# kldload accf_http

kldload: can't load accf_http: File exists
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,716
Messages: 11,252

#2
Are you running Apache from a jail, perhaps? I have a non-jailed Apache 2.2.21 with these settings in /boot/loader.conf:
Code:
accf_data_load="YES"
accf_http_load="YES"
Code:
# kldstat -v | grep accf                                                                                                
 2    1 0xc0a20000 185c     accf_data.ko (/boot/kernel/accf_data.ko)
		 1 accf_data
 3    1 0xc0a22000 22c0     accf_http.ko (/boot/kernel/accf_http.ko)
		 2 accf_http
and it works as advertised. If you're running it from a jail, make sure the hosts's settings are correct.
 
OP
OP
H

hurricane_sh

Member


Messages: 43

#3
No, not in jail. I don't have the accf_data_load line, just gave it a try and it didn't seem to make any difference. Used "kldload accf_http" on several servers, it always worked well.

Code:
# kldstat -v | grep accf
 3    1 0xffffffff80dee000 15e0     accf_http.ko (/boot/kernel/accf_http.ko)
                 2 accf_http
 5    1 0xffffffff81022000 1ea      accf_data.ko (/boot/kernel/accf_data.ko)
                418 accf_data
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,716
Messages: 11,252

#4
Maybe run [cmd=]truss service apache22 start[/cmd] and trawl through the output. There must be something of a flag in there.

The only thing that shows up in mine is
Code:
read(10," -v | grep accf_http > /dev/null"...,1023) = 1023 (0x3ff)
which appears to suggest that a [cmd=]kldstat -v | grep accf_http[/cmd] is being performed.
 
OP
OP
H

hurricane_sh

Member


Messages: 43

#5
Thanks, DutchDaemon. Never used truss, it seems to make other commands running in kinda like debug mode. I'm building a new server and will try it on it first. I will report back.
 
OP
OP
H

hurricane_sh

Member


Messages: 43

#6
The new server has the same problem, and I was wrong in my first post, actually it only happens when doing (graceful) restart and Apache was started with apachectl.

If I use the service command to start Apache, the warning will not show up no matter how I restart Apache.

DutchDaemon, you will very probably see the warning as well if you start Apache with

Code:
# apachectl start
and then do any of the following commands:
Code:
# apachectl restart
# apachectl graceful
# service apache22 restart
# service apache22 graceful
What's the difference between "service apache22 ..." and "apachectl ..."? The warning doesn't seem to do any harm, I think it should be OK to ignore it, or I start using service command. :)
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,716
Messages: 11,252

#7
Well, using either service(8) or the start scripts in (/usr/local)/etc/rc.d/ has always been the way to start/restart/stop daemons on FreeBSD. And if you look in the /usr/local/etc/rc.d/apache22 start script, you will find:

Code:
apache22_accf() {

  if checkyesno apache22_http_accept_enable; then
    /sbin/kldstat -v | grep accf_http > /dev/null 2>&1 || /sbin/kldload accf_http || return ${?}
    /sbin/kldstat -v | grep accf_data > /dev/null 2>&1 || /sbin/kldload accf_data || return ${?}
  else
    apache22_flags="${apache22_flags} -DNOHTTPACCEPT"
  fi
}
Fancy that ... apachectl will not see that.
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Thanks: 2,716
Messages: 11,252

#9
I think you should only really use apachectl for a 'graceful' restart (re-reading of the configuration files). But not for starting, restarting, and stopping.

Oh wait, that's now in the apache22 script as well:
Code:
graceful_cmd="apache22_graceful"
So [cmd=]service apache22 graceful[/cmd] works too.
 

nORKy

Well-Known Member

Thanks: 18
Messages: 307

#10
DutchDaemon said:
I think you should only really use apachectl for a 'graceful' restart (re-reading of the configuration files). But not for starting, restarting, and stopping.

Oh wait, that's now in the apache22 script as well:
Code:
graceful_cmd="apache22_graceful"
So [cmd=]service apache22 graceful[/cmd] works too.
or
[cmd=]service apache22 reload[/cmd]
 

arie01

Member


Messages: 32

#11
Hello,

I have (almost) the same issue. I just installed apache22 on FreeBSD 9.0 and I can't start it gracefully or in any other way. When I issue /usr/local/sbin/apachectl start I keep getting the following error message:

Code:
[Wed Mar 14 08:32:29 2012] [warn] (2) No such file or directory: Failed to enable the 'httpready' Accept Filter
I tried a few of the options mentioned on this thread but I was not successful. Any way I could get some help?

Just to let you know, I have very little experience with FreeBSD doing the usual and simple stuff, nothing really advanced.
Thank you,
 

AlexJ

Active Member

Thanks: 37
Messages: 127

#12
@arie01

Do not use graceful (re)start if you use httpready/httpdata in Apache. It is a very old bug and nobody knows who is responsible for that - either FreeBSD or Apache. Use [cmd=]/usr/local/etc/rc.d/apache22 restart[/cmd] instead to avoid
Code:
...Failed to enable the 'httpready' Accept Filter
and add
Code:
<IfDefine !NOHTTPACCEPT>
   AcceptFilter http  httpready
   AcceptFilter https dataready
</IfDefine>
in httpd.conf and
Code:
apache22_http_accept_enable="YES"
to the /etc/rc.conf.
 

Chris_H

Daemon

Thanks: 186
Messages: 1,076

#13
Greetings,
I'm experiencing the same issues. It's a PIA! :\
kldstat(8) reveals:
Code:
udns# kldstat
Id Refs Address            Size     Name
 1   30 0xffffffff80100000 93a738   kernel
 2    3 0xffffffff80a3b000 47958    linux.ko
 3    1 0xffffffff80a83000 4fe88    pf.ko
 4    2 0xffffffff80ad3000 76338    sound.ko
 5    1 0xffffffff80b4a000 25268    snd_hda.ko
 6    1 0xffffffff80b70000 918      [color="Red"]accf_data.ko[/color]
 7    1 0xffffffff80b71000 938      [color="Blue"]accf_dns.ko[/color]
 8    1 0xffffffff80b72000 15e0     [color="Red"]accf_http.ko[/color]
 9    1 0xffffffff80b74000 10a3078  nvidia.ko
10    1 0xffffffff81e12000 40c3     linprocfs.ko
I notice that this has been an issue in Apache since 2008, and it's not limited to FreeBSD. Why hasn't anything other than a kludge ever been implemented?! Apparently Apache2 has been abandoned, just as was Apache1. x( I fail to see what Apache2 brings to the table, that Apache1 didn't already. In fact, when the EOL was announced for Apache1, I was given the "OK", when I announced my interest in maintaining it (grep the @stable list for more detail). I sucked the last version available down, just before they dropped cvs(1), for svn(1). However, at that time, I was purchasing a house, which meant changing ISP's which would also necessitate acquisition of a different /24 (IP block). So I didn't immediately pursue it. Now being somewhat more settled in, and discovery of this added nonsense in Apache2, I think it's time to move forward. I'll have to get it back into ports before doing too much more. But I'm definitely more motivated now!
As to AlexJ's comment above:
Code:
<IfDefine !NOHTTPACCEPT>
   AcceptFilter http  httpready
   AcceptFilter https dataready
</IfDefine>
Apache2 installs a /usr/local/etc/apache22/includes/no-accf.conf the contents of which, is:
Code:
<IfDefine NOHTTPACCEPT>
   AcceptFilter http none
   AcceptFilter https none
</IfDefine>
Note the absence of the exclamation mark (!). Using (including) it appears to have no (positive) effect. Anyway, if I find time today, I might grep the www/apache22 source for any clues to a possible cure. Failing that, expect to find Apache1 "and friends" back in the ports tree soon. :)

l8r

P.S. I'm not convinced this is as "harmless" as has been implied/stated. :\
 

wook

New Member


Messages: 1

#14
I've had same problem, fixed by editing rc.conf but, my server was refusing to run even after that, why, because i tried to save myphpadmin logs into non existing directory :D
so, check twice:
Code:
	DocumentRoot "/usr/local/www/apache22/phpMyAdmin"
...
	CustomLog /usr/local/www/logs/phpmyadmin-access_log combined
	ErrorLog /usr/local/www/logs/phpmyadmin-error_log
 

euxneks

New Member


Messages: 1

#15
Hi, sorry to rehash an old thread but this was high on the Google search results for the original error message. I found that this error message was also being reported when I recently changed the name of the machine. I'm using a virtual machine so I decided to rename it tardis recently. Apache then didn't know what the heck tardis was, and reported this error - I thought perhaps if it was reporting this error, it was something else other than the recent name change of my virtual machine. I was wrong.

I looked at the Apache error logs and it reported this:
Code:
hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "tardis"
I had previously named it gallifrey and put that name in /etc/hosts associated with local IPs and localhost, etc. Because this is a simple VM I have a pretty horrid config, but it works for testing. In any case, replacing gallifrey with tardis in /etc/hosts worked.

I am posting this for those out there who may come across a similar problem but perhaps they haven't had their morning coffee ;)
 
Top