apachefs
is a Python script which makes you able to locally mount a file tree served by Apache (like the Heanet public mirror). It's the default apache's behavior when it has to serve a file tree without any index.html
file. The filesystem is obviously read-only.
Works on Linux, MacOS X, FreeBSD.
First get the code of this repository.
$ git clone http://github.com/Gawen/apachefs
$ cd apachefs
Before actually using the script, you will first require to install fusepy
and BeautifulSoup
.
$ pip install fusepy beautifulsoup
The script to use is named apachefs.py
.
$ ./apachefs.py --help
Usage: apachefs.py [options]
Options:
-h, --help show this help message and exit
-v, --verbose
-f, --foreground
-v
sets the log's level to debug. -f
keeps the process to foreground.
For example, let's mount the Ubuntu's heanet mirror: http://ftp.heanet.ie/pub/ubuntu-cdimage/releases/.
$ mkdir heanet
$ ./apachefs.py http://ftp.heanet.ie/pub/ubuntu-cdimage/releases/ heanet
$ cd heanet
$ ls
10.04
10.04.1
10.04.2
10.04.3
10.04.4
11.10
12.04
12.04.1
12.10
8.04
8.04.1
8.04.3
8.04.4
hardy
lucid
oneiric
precise
quantal
$
The cd heanet
and ls
operations could take a while, because it requires the script to do a HTTP HEAD
request for each of the files in the directory to have the file meta-attributes.
To un-mount the filesystem, just type.
$ fusermount -u heapnet
And you're done.
The code is under MIT license.
- fusepy repository: https://github.com/terencehonles/fusepy
- BeautifulSoup website: http://www.crummy.com/software/BeautifulSoup/
- Heapnet public mirror, an URL compatible with
apachefs
: http://ftp.heanet.ie/pub/