Solved Apache 2.4 and Accept Filters

Hi,

A little confused regarding what actions are required to make this work. I'm pretty used to the accept filters with www/nginx.

I have the accept filters loaded:
Code:
 1   20 0xffffffff80200000 1fa7c38  kernel
 2    1 0xffffffff821a9000 30aec0   zfs.ko
 3    2 0xffffffff824b4000 adc0     opensolaris.ko
 4    1 0xffffffff82621000 1046     accf_dns.ko
 5    1 0xffffffff82623000 d8e      accf_data.ko
 6    1 0xffffffff82624000 1875     accf_http.ko
 7    1 0xffffffff82626000 2c0a     coretemp.ko
 8    1 0xffffffff82629000 21aa     cc_htcp.ko
and have restarted www/apache24 without issue.

Documentation online seems to be unclear if I have to edit httpd.conf to instruct www/apache24 to use the accept filters. Does www/apache24 automatically use them?

I did see an instruction to use
Code:
apache24_http_accept_enable="YES"
and
Code:
apache24_accept_enable="YES"
in /etc/rc.conf.

Seems a little unclear to see if www/apache24 is actually using it.

Does anyone have experience with these filters and www/apache24?
 
I was unsure myself, and so I had a look into the apache24 rc-script.

Excerpt from /usr/local/etc/rc.d/apache24:
Code:
...
# apache24_http_accept_enable (bool): Set to "NO" by default.
#                             Set to yes to check for accf_http kernel
#                             module on start up and load if not loaded.
...
...
apache24_accf()
{
  if checkyesno apache24_http_accept_enable; then
    /sbin/kldstat -qm accf_http || /sbin/kldload accf_http || return ${?}
    /sbin/kldstat -qm accf_data || /sbin/kldload accf_data || return ${?}
  else
    apache24_flags="${apache24_flags} -DNOHTTPACCEPT"
  fi
}
...
The default setting of apache24_http_accept_enable is "NO", and that means, that apache is started with the command line directive -DNOHTTPACCEPT, which is self-explanatory. Actually, ps -ax | grep httpd shows that all my instances are launched with that flag.

In the case of apache24_http_accept_enable="YES", the respective kernel modules are loaded and Apache 24 is started in it's personal default mode, i.e. using the Accept Filters.

So, some confusion arises, because the Apache developers and the Apache port maintainer disagree on what should be the default behaviour on FreeBSD with respect to the Accept Filters.
 
Hi,

Yes the addition of
apache24_http_accept_enable="YES"
solved it.

Code:
ps ax | grep httpd
1832  -  Ss     0:00.01 /usr/local/sbin/httpd
1833  -  S      0:00.00 /usr/local/sbin/httpd
1834  -  S      0:00.00 /usr/local/sbin/httpd
1835  -  S      0:00.00 /usr/local/sbin/httpd
1836  -  S      0:00.00 /usr/local/sbin/httpd
1837  -  S      0:00.00 /usr/local/sbin/httpd
1839  0  S+     0:00.00 grep httpd

PS. What did you use for the green highlight? The only one I know is
 
It's also used for things like this as we don't have any other tags for it. Ideally it should be placed in [code] blocks but that breaks the text if you try to use it in-line. Not ideal but at least it doesn't interfere with the flow of the text.
 
So the green formatting used was technically incorrect, as that relates to file?
Strictly speaking yes, however, for me I already released the very strict interpretation of "file" being meant for File System Names. I use this formatting within text bodies for any kind of Operating System Specifiers. At least up to now nobody complained about my deliberated usage of file formatting.
 
I liked it. It helped draw attention to the pertinent parts.

I was considering taking it up myself. Imitation is the highest form of flattery after all.
 
Back
Top