ApacheMirror.py for a site-local Fedora mirror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having tired of babysitting the rsync cron job that was keeping my
local Fedora mirror up-to-date, I tried the caching proxy approach
suggested at http://fedoraproject.org/wiki/Infrastructure/Mirroring/SiteLocalMirrors
for a few weeks. This, too, was unsatisfactory--I still want some
control over the mirrored content and the ability to pre-populate the
cache from a DVD ISO acquired via bittorrent when a new version of
Fedora is released.

ApacheMirror.py is a mod_python request handler that behaves like a
caching proxy, except it maps the URL path of a cached document
directly to a local directory rather than hashing the URL, this
preserving the mirror directory structure.

Just drop ApacheMirror.py into /usr/lib/python*/site-packages, set
your preferred upstream server and point it at a local directory on a
nice big disk, and forget it:

<VirtualHost *:80>
   ServerName mirrors.sample.com
   ServerName mirrors
   DocumentRoot /mirrors

   SetHandler mod_python
   PythonHandler ApacheMirror
   PythonDebug on
   PythonOption ApacheMirror.upstream http://download.fedora.redhat.com
</VirtualHost>

The implementation is by no means bulletproof--consider this release
0.1--but it's worked well enough to serve local yum needs for the past
few days.

If there's interest, I could package up the script into an srpm (which
seems overkill for 50 lines of Python) or submit it as a patch to some
existing package.

--Ed

Attachment: ApacheMirror.py
Description: Binary data

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux