1

I am trying to modify the apache source code in order to let it read the files inside a zip file instead of getting it directly from www folder.

example:

instead of having www/index.htm

I want to have a zip file that contains the index.htm

I've been working on this for days. Is it possible or I am just wasting my time?

Porizm
  • 531
  • 4
  • 16
  • What would be the point of doing this? Disk storage is so cheap now; wouldn't it be easier to just keep the data uncompressed? – r3mainer Mar 07 '16 at 02:30
  • 2
    There are several possibilities, including 1) writing your own Apache module, 2) Write a CGI to unzip/upload files on-the-fly, 3) mount [Fuse-Zip filesystem](https://bitbucket.org/agalanin/fuse-zip) etc. See this (duplicate): [Make Apache virtual directory from the contents of a zip file](http://stackoverflow.com/questions/8420295/make-apache-virtual-directory-from-the-contents-of-a-zip-file) – paulsm4 Mar 07 '16 at 02:56

1 Answers1

3

You may indeed be wasting your time, but that doesn't mean it's not possible. Apache certainly doesn't have any native capacity to treat a zipfile as a filesystem, but there are solutions you can pursue.

The simplest option would be to use something like archivemount to expose the archive as a filesystem on the host. This will let Apache -- and anything else -- treat it like a directory tree.

larsks
  • 277,717
  • 41
  • 399
  • 399