Q. I’ve installed Apache 2.2 from FreeBSD 7.0 ports and when I try to start I get following warning on screen:

Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
[Wed Sep 17 22:01:58 2008] [warn] (2)No such file or directory: Failed to enable the ‘httpready’ Accept Filter

How do I fix this error?

A. FreeBSD has special driver called accf_http. It will buffer incoming connections until a certain complete HTTP requests arrive to speed up and optimize performance.

The utility of accf_http is such that a server will not have to context switch several times before performing the initial parsing of the request. This effectively reduces the amount of required CPU utilization to handle incoming requests by keeping active processes in preforking servers such as Apache low and reducing the size of the file descriptor set that needs to be managed by interfaces such as select(), poll() or kevent() based servers.

Just open shell prompt and type the following command to load accf_http under FreeBSD :
# kldload accf_http
Restart apache:
# /usr/local/etc/rc.d/apache22 restart

Update /boot/loader.conf file

Type the following command so that driver get loaded at the time of booting system:
# echo 'accf_http_load="YES"' >> /boot/loader.conf

A note about FreeBSD jails (vps)

Under jail you cannot load this module. It needs to be loaded from host using above command.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 11 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
11 comments… add one
  • Florin Grosu Jun 25, 2009 @ 14:19

    Is there any other linux distro with this option? Or a “accf_http like” way for red hat, or ubuntu? I’m asking this question, having in mind the slowloris attack.

    • 🐧 nixCraft Jun 25, 2009 @ 15:42

      Noop, there is not such thing for Linux. Set your apache timeout to 30, use iptables to limit connection per IP, there is also unoffical patch that changes Timeout on fly.

  • motivez Jan 31, 2010 @ 21:46

    I have done the above, but whenever I get a graceful restart request during log rollovers, I am still getting the error.. additionally, my Apache is segfaulting after every graceful restart.

    Any suggestions?

  • hexabit May 7, 2010 @ 7:13

    In fact this solution does not help in my case (FreeBsd 7.2 amd64) so I recompiled the kernel with both modules (accf_http and accf_data) filters hoping it will help… unfortunately this didn’t help either – but strangely apache seems to work without problems… but message “[warn] (2)No such file or directory: Failed to enable the ‘httpready’ Accept Filter” is still present in the logs…

  • pascal May 21, 2010 @ 18:53

    this works for me (FreeBSD 8.0 i386 and Apache 2.2.15). Thanks

  • Ben Oct 21, 2010 @ 8:45

    It doesn’t work, and I got kidload: Command not found
    (FreeBSD 8.1 amd64 and Apache 2.2.15_9 )

    • 🐧 nixCraft Oct 21, 2010 @ 8:52

      It is


      and not the


      You got a typo in your command.

  • Ben Oct 21, 2010 @ 16:47

    Thanks a lot … sorry for my typo error. Now I got the message “kldload: can’t load accf_http: File exists”, I think the system has loaded the module already.

    but the httpd still not running… haha…and I cannot figure out why….

    I have tried portsnap fetch extract to update /usr/ports to the most update…and install apache22.17 , but it still doesn’t function….

    Because I am in a vbox machine to test FreeBSD ? There is no full-qualified hostname….but why ? I’ve studies the handbook again and again….haha…don’t know why, I just cannot start apache22

    • 🐧 nixCraft Oct 21, 2010 @ 17:21

      Check your Apache error log and access log files.

  • Ben Oct 21, 2010 @ 18:19

    I come back to say “Thank you”. When I was very frustrated … I took a shower…and come back to my PC to fight again…I get it WORKS!!

    This is another typo error, while I checked the error log, it said hostname nor servname provided, or not known: ….HAHA… and the hostname in the error log is not the one I put in /etc/hosts file ( just a private dummy hostname)

    It took me so long to get it works… thank you again!! ( Today is my first day to try FreeBSD, wonderful experience!! especially, I send command : portmaster -a, it took so long to upgrade all ports. )

  • ben Nov 17, 2010 @ 2:27

    It’s a little bit of confused after study FreeBSD installation of Apache. Can you help me to figure out what should I do?

    After install the port of apache22, I noticed the auto-generated file /usr/local/etc/apache22/Includes/no-accf.conf including the following directive:

    AcceptFilter http none
    AcceptFilter https none

    and I also find the description in Apache official site, http://httpd.apache.org/docs/2.2/mod/core.html:
    The default values on FreeBSD are:
    AcceptFilter http httpready
    AcceptFilter https dataready

    There is no warning or error in http_error_log after I follow your instruction to load accf_http driver, but I am wondering if I should delete no-accf.conf file, and add the above directives for apache 2.2.17 , since I’ve already load the driver into FreeBSD? Or do nothing? ( I’ve tried both, but doesn’t find any difference)

    Also, I’ve noticed a lot of simultaneous message logs like following generated by a very close & legal visit to the server. Is it related to the accept filter driver?

    kernel: TCP: [visitor’s ip]:37229 to [server’s ip]:80 tcpflags 0x4; syncache_chkrst: Spurious RST without matching syncache entry (possibly syncookie only), segment ignored

    or a lot of three way shaking failed messages( if from very far location to visit the server) , e.g.
    _syncache_add: Received duplicate SYN, resetting timer and retransmitting SYN|ACK
    syncache_timer: Response timeout, retransmitting (1) SYN|ACK
    syncache_timer: Response timeout, retransmitting (1) SYN|ACK

    ps. I set ipfw limit 50 simultaneous connections for the same IP to visit the site to prevent DoS attack.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum