update-publicfile-contenttype(1)

NAME
update-publicfile-contenttype - generate a CT-style envdir from mime.types formatted input

SYNOPSIS
update-publicfile-contenttype directory

DESCRIPTION
update-publicfile-contentype generates a CT-style envdir under directory from /etc/mime.types formatted input on stdin. The file /etc/mime.types is described by Brian White and others, development started in the late 1990s. If /etc/mime.types contains e.g. a line image/jpeg jpeg jpg, then this script would create the files CT_jpeg, CT_jpg, CT_JPEG and CT_JPG in directory, all containing image/jpeg as the first line.

If publicfile with Uwe Ohse's filetype patch, e.g. as shipped with the publicfile package for Debian, finds an unknown file extension .ext, envdir looks for a file called CT_ext. If this file exists, publicfile will use its first line as the MIME type.

USAGE
Call this script as e.g.

    update-publicfile-contenttype /etc/publicfile/mime \
     </etc/mime.type

Make publicfile use the generated envdir under /etc/publicfile/mime by adjusting /etc/publicfile/httpd/run: replace the last two words (likely "httpd /etc/publicfile/file") by "envdir /etc/publicfile/mime httpd /etc/publicfile/file". The complete file /etc/publicfile/httpd/run could e.g. be

    #!/bin/sh
    exec 2>&1
    exec envuidgid www-data softlimit -o20 -d100000 \
     tcpserver -vDRHl0 -b50 -c100 0 80 \
     envdir /etc/publicfile/mime httpd /etc/publicfile/file

BUGS
The script does does not do any error checking. If needed permissions are lacking, behaviour is undefined. The script ignores and possibly overwrites any already CT_ext files present.

AUTHOR
Written by Joost van Baal-Ilić.

No copyright is claimed. The update-publicfile-contenttype code and this manpage are in the public domain; do with it what you wish.

SEE ALSO
A by Cliff L. Biffle. The authors