The FILE module
This module transmits normal, unparsed, document files. Depending on
the configuration file it tags the returned document with the correct
MIME types and encodings, and also provides the correct length of the
document.
Configuration options (file.conf)
- content-types (table)
- Table of MIME types to use for different file suffixes.
- content-encodings (table)
- Table of MIME encodings to use for different file suffixes.
- default-type (string)
- The default MIME type to use if not found in the content-types
table. Defaults to "unknown".
- method-put (boolean)
- Disable HTTP-upload of files globally. Default is NO.
- method-delete (boolean)
- Disable HTTP-method DELETE globally. Default is NO.
- allow-root-write (boolean)
- Since phttpd will happily follow symbolic links and I (Roland Kaltefleiter)
am careful in case of security, this will prevent files owned by root
to be removed, overwritten or created in directories owend by root,
even if group/other access rights would allow that !
Default is NO.
- allow-rmdir (boolean)
- This will allow a DELETE /url/path , if /url/path translates to a
directory. Watch out, not to end up with / !! Default is NO.
- allow-implied-mkdir (boolean)
- In case you publish, this will allow you to create directories.
Currenty, if you have /path, and want to load /path/dir/file.html
this will do a mkdir on /path/dir and then continue to create the file.
You cannot do a 'mkdir -p' at this version of phttpd. Default is NO.
- write-needs-putdir (boolean)
- This will allow access only to files that match the patter of the
"homedir" field in the access-handler. This requiers, that
the accessfile is in 'passwd' format.
Thus users can only modify specific parts.
The homedir is matched against patterns:
e.g.: homedir= /updir/*html will only allow files below serverroot in
the directory updir (or subdirs of that) ending on html being changeable.
sample for 'passwd-style' authfile:
user:crypted-pw:uid:gid:gcos:/updir/*html:/noshell
Currently uid/gid and gcos are not used, but this will change in a later version!
- read-needs-putdir (boolean)
- Same as write-needs-putdir but for authenticated read requests.
So you can have several Users in the same file and restrict access to
subdirs etc.
Example configuration file
# file.conf
### Global allow/deny the PUT method
# method-put = no
### Global allow/deny the DELETE method
# method-delete = no
# default-type = unknown
### If put or delete is allowed, this will prevent files owned by root
### to be removed, overwritten or created in directories owend by root,
### even if group/other access rights would allow that !
#
# allow-root-write = no
### This will allow access only to files that match the patter of the
### "homedir" field in the access-handler. This requiers, that
### the accessfile is in 'passwd' format.
### Thus users can only modify specific parts.
### The homedir is matched against patterns:
### e.g.: homedir= /updir/*html will only allow files below serverroot in
### the directory updir (or subdirs of that) ending on html being changeable...
###
### sample for 'passwd-style' authfile:
### user:crypted-pw:uid:gid:gcos:/updir/*html:/noshell
### Currently uid/gid and gcos are not used, but this will change (?)
#
# write-needs-putdir = yes
### Same as write-needs-putdir but for authenticated read requests.
### So you can have several Users in the same file and restrict access to
### subdirs etc.
#
# read-needs-homedir = no
###
### This will allow a DELETE /url/path , if /url/path translates to a
### directory. Watch out, not to end up with / !!
#
# allow-rmdir = no
### In case you publish, this will allow you to create directories.
### Currenty, if you have /path, and want to load /path/dir/file.html
### this will do a mkdir on /path/dir and then continue to create the file.
### You cannot do a 'mkdir -p' at this version.
#
# allow-implied-mkdir = no
content-encodings = {
.Z x-compress
.gz x-gzip
}
content-types = {
.html text/html
.HTML text/html
.htm text/html
.txt text/plain; charset=ISO-8859-1
.tsv text/tab-separated-values; charset=ISO-8859-1
.gif image/gif
.GIF image/gif
.jpeg image/jpeg
.jpg image/jpeg
.JPG image/jpeg
.tiff image/tiff
.tif image/tiff
.xbm image/x-xbitmap
.ps application/postscript
.eps application/postscript
.pdf application/pdf
.rtf application/rtf
.java application/java
.class application/java-vm
.jar application/x-java-archive
.mif application/x-mif
.dvi application/x-dvi
.man application/x-troff-man
.tar application/x-tar
.cdrw application/x-coreldraw
.cdr application/x-coreldraw
.doc application/x-word
.tcl application/x-tcl
.hqx application/mac-binhex40
.sit application/x-stuffit
.bin application/x-macbinary
.au audio/basic
.snd audio/basic
.mid audio/midi
.midi audio/midi
.aiff audio/aiff
.wav audio/x-wav
.ampg audio/mpeg
.ampeg audio/mpeg
.mpeg video/mpeg
.mpg video/mpeg
.qt video/quicktime
.ra audio/x-pn-realaudio
.ram audio/x-pn-realaudio
.fh4 image/x-freehand
.fh5 image/x-freehand
.fhc image/x-freehand
}