[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Mime-Type configuration for Debian official Mirrors - best practices?



Dear mirrors maintainers and colleagues,

Are there any best practices for defining the mime-type of Debian mirrors when serving files over HTTP? I have been unable to find any guidance on how to best configure this. 

This week a user reached out to me, as maintainer of ftp.es.debian.org, asking me why they had to download some files to read them, and could not see in the web browser. This happened for some text files that lack an extension such as the README or the ChangeLog. For these files the web server listed the MIME-type as "application/octet-stream"

After reviewing the behaviour of other official mirrors and after fiddling with our setup with lighttpd I ended up adding the attached file to /usr/local/bin/ and changing in lighttpd's conf file, this:

include_shell "/usr/share/lighttpd/create-mime.assign.pl"
to
include_shell "/usr/local/bin/lighttpd-create-mimetypes.conf.pl"

The attached Perl script, derived from a script for lighttpd 2, sets the mime types for some of the text filenames that are found in the archive.

I opted to do this instead of setting as the default mime-type to "text/plain" to prevent binary files from being sent as text files.

If other mirror admins can suggest better or alternative approaches I would be happy to hear about them.

Best regards

Javier


Attachment: lighttpd-create-mimetypes.conf.pl
Description: Binary data


Reply to: