1

I am running Apache/2.4.38 (Raspbian). When requesting HTML and PHP everything works fine. When I request a .jpg file, apache seems to skip a few bytes at the beginning of the response header, and some garbage is included at the end of the payload.

Specifically, after GET /images/2.jpg HTTP/1.1 the response looks like:

21 19:00:13 GMT
ETag: "23fa-5cf6e52077278"
Accept-Ranges: bytes
Content-Length: 9210
Keep-Alive: timeout=5, max=97
Connection: Keep-Alive
Content-Type: image/jpeg

Previous responses within the same session looked correct like:

HTTP/1.1 200 OK
Date: Mon, 01 Nov 2021 19:08:49 GMT
Server: Apache/2.4.38 (Raspbian)
...

This only happens for JPEG images. The image file itself is okay, I can view it with gwenview. The same faulty response is sent whether I try with chrome, with wget, or even manually with netcat. Always the same faulty response.

How can that happen, and how can I fix it?

Harald
  • 11
  • 1
  • Yes the issue was only for images but not for text files. You should have « accept » the answer below if it worked for you. – phili_b Sep 13 '22 at 06:10

1 Answers1

1

I found the answer after searching specifically for "apache jpeg cifs share". It is a known bug caused my mmap not working on files on a CIFS share. Solution is to set EnableMMAP off in the apache configuration for all folders on CIFS shares.

  • Thanks for the explanation about CIFS and not only `EnableMMAP off`: a cifs disk partition mounted was exactly my cause on Ubuntu. – phili_b Sep 13 '22 at 06:04