Broken sendfile() and the advantage of using wget
Posted by Sayamindu 3 years ago
While working on the Live CD for Koha, I noticed that once in the Live CD environment, Apache served dynamic (perl) pages perfectly, but all static content (CSS files, images, etc) seemed to be truncated at 0 bytes (though I could see that their sizes were in the range of kilobytes from the directory listing provided by Apache). The error log did not indicate anything, nor did the access log. I fired up Xterm, and ran wget on a static page. Wget reported:
Connection closed at byte 0
After some googling, it turned out that there is something broken with sendfile() in the Live CD I was working on. I added EnableSendfile Off at the end of httpd.conf, and after that, things worked out perfectly. If someone is interested, more information on the EnableSendfile directive is available in the Apache documentation.
