# apache - some images are not loading...



## hexabit (Sep 28, 2009)

Hi, 

I recently set up a FreeBSD web server (FreeBSD 7.2 amd64) on Apache 2.2.11.

For some time the server works perfectly. But from time to time i got error messages in log (/var/log/http-error.log):


```
[Mon Sep 28 13:57:00 2009] [notice] caught SIGTERM, shutting down
[Mon Sep 28 13:57:04 2009] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 28 13:57:04 2009] [notice] Digest: done
[Mon Sep 28 13:57:04 2009] [notice] Apache/2.2.11 (FreeBSD) DAV/2 PHP/5.2.10 with Suhosin-Patch configured -- resuming normal operations
[Mon Sep 28 15:41:57 2009] [notice] SIGHUP received.  Attempting to restart
[color="Red"][Mon Sep 28 15:41:57 2009] [warn] (22)Invalid argument: Failed to enable the 'httpready' Accept Filter[/color]
[Mon Sep 28 15:41:58 2009] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 28 15:41:58 2009] [notice] Digest: done
```

And from this point when i try to load a web page some of images are taking forever to load, but others are load fast. I have accf_data and accf_http compiled into kernel - previously i loaded them via (/boot/loader.conf) but this changes nothing - the error still appeared. 

So the only temporary solution that i found to this is to reboot the machine. Again then for some time server works like charm until suddenly 'httpready' error apprears in apache log and then everything starts from beginning. While loading the web page it looks like browser is hung in some infinite loop.

I noticed that images affected by this error are (.jpg) and (.png).

Another thing - the images are not broken when i download them via ftp and open localy - they look as they should.

Please help me.


----------



## SirDice (Sep 28, 2009)

hexabit said:
			
		

> So the only temporary solution that i found to this is to reboot the machine.


How about just restarting apache?

`# /usr/local/etc/rc.d/apache22 restart`


----------



## hexabit (Sep 28, 2009)

Restarting apache does not solve the issue, it restarted witout "warn" message about the "httpready", but images are still not loading. Stoping apache and starting it does not make any difference either.


```
apachectl restart
apachectl stop
apachectl start
```

all code above does not solve the issue !

Further investigating the case - mod_deflate does not affect the loading of images - the issue is still present with or witout it enabled, the same is with mod_ssl (mod_ssl is disabled on my server), (mod_deflate is currently enabled and works perfect)...


----------



## phospher (Sep 28, 2009)

are you sure that it's loading into your kernel? do you see it with the command:


```
kldstat
```

if not try:


```
kldload accf_http
```


----------



## hexabit (Sep 28, 2009)

sorry for double post but i found this thread which backs in time to 2007 and describing similar or maybe exactly the same problem:

http://www.hotscripts.com/forums/web-servers/36835-apache-only-loads-images-partly.html

there is a part which describes the "not loading of images" problem:



> (...) I am experiencing the same problem, also apache 2.2 on XP.
> It doesn't do it cut off every JPG file though, it still displays some correctly.
> If i open the jpg via file:// in firefox , there is never a problem.
> 
> ...



At the end of this thread is a possible solution:


```
The issue is, to change 2 lines in Appache configuration file httpd.conf

#EnableMMAP off
#EnableSendfile off

Delete the '#'. Restart Apache process.
```

I will post wheter this works or not for my server.


----------



## hexabit (Oct 6, 2009)

it looks like changing options in apache configuration 'httpd.conf' to:


```
EnableMMAP off
EnableSendfile off
```

*solved the issue.* Here is what '/var/log/httpd-error.log' say:


```
--

[Mon Sep 28 17:33:18 2009] [notice] Apache/2.2.11 (FreeBSD) PHP/5.2.10 with Suhosin-Patch configured -- resuming normal operations
[Mon Sep 28 22:22:20 2009] [notice] caught SIGTERM, shutting down
[Mon Sep 28 22:22:24 2009] [notice] Apache/2.2.11 (FreeBSD) PHP/5.2.10 with Suhosin-Patch configured -- resuming normal operations
[Tue Oct 06 01:23:21 2009] [notice] caught SIGTERM, shutting down
[Tue Oct 06 01:23:25 2009] [notice] Apache/2.2.11 (FreeBSD) PHP/5.2.10 with Suhosin-Patch configured -- resuming normal operations
```

There is no warning about 'httpready' and there is no problem with loading images.

Please mark this thread as solved.


----------

