Public bug reported: The default `/etc/apache2/magic` file that comes with apache2 seems to be broken.
I don't know what exactly is the problem, but here are a few details that demonstrate that it is indeed broken: * echo -e "<!DOCTYPE HTML>\nblah blah" > /tmp/foo * file -m /etc/apache2/magic /tmp/foo => Shows a bunch of "string modifier `B' invalid" warnings and finally: "could not find any valid magic files!" * Trying to fetch this file via apache for a configuration that has "a2enmod mime_magic" results in no Content-Type header * Now, get the original magic file from https://raw.githubusercontent.com/apache/httpd/trunk/docs/conf/magic drop it in the same place: => the `file` command now works as expected, => fetching the file via apache has the expected Content-Type header * Alternatively, modify the original magic file by removing all "B" modifiers (on lines 187, 402, 403, 404, 405, 622, 627, 631, 632) => both the `file` command and the header from apache work --- version information: $ lsb_release -rd Description: Ubuntu 22.04.1 LTS Release: 22.04 $ apt-cache policy apache2 apache2: Installed: 2.4.52-1ubuntu4.2 Candidate: 2.4.52-1ubuntu4.2 Version table: *** 2.4.52-1ubuntu4.2 500 500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages 100 /var/lib/dpkg/status 2.4.52-1ubuntu4.1 500 500 http://us.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages 2.4.52-1ubuntu4 500 500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages ** Affects: apache2 (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Server/Client Support Team, which is subscribed to apache2 in Ubuntu. Matching subscriptions: Ubuntu Server/Client Support Team https://bugs.launchpad.net/bugs/2003709 Title: Apache2 magic mime file is broken (2.4.52-1ubuntu4.2) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/2003709/+subscriptions -- Mailing list: https://launchpad.net/~enterprise-support Post to : enterprise-support@lists.launchpad.net Unsubscribe : https://launchpad.net/~enterprise-support More help : https://help.launchpad.net/ListHelp