Personal tools
You are here: Home mod_unzip: access ZIP files transparently via Apache

mod_unzip: access ZIP archives transparently via Apache

mod_unzip is a small Apache 2.0 module to transparently access files that are compressed in a ZIP archive. Since the ZIP format has an index for all files in the archive, accesses are very fast. The module also allows to browse the content of the ZIP archive by directory.

Dependencies

The only dependencies for the module are:

  • Info-Zip unzip binary which can be executed by the Apache user (http://www.info-zip.org/, comes with most Linux distributions)
  • apxs2 – the Apache Extension Tool to compile the module
  • libmagic + headers (libmagic-dev) to determine the correct MIME type of the files in the archive

How to install

  1. Download the source file
  2. Adjust 'UNZIP_EXEC' to the path of your unzip program (e.g. /usr/bin/unzip)
  3. as root compile with
    root@somewhere# apxs2 -i -c mod_unzip.c -lmagic
  4. load the module within your httpd.conf
    LoadModule unzip_module /usr/lib/apache2/modules/mod_unzip.so
    AddType application/zip .zip
  5. restart webserver
Document Actions