r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: mod_pak serve HTTP downloads from PAK and ZIP (.pkz) archives
Pages: [1]
Print
Author Topic: mod_pak serve HTTP downloads from PAK and ZIP (.pkz) archives  (Read 3896 times)
[SkulleR]
Member

Posts: 7


« on: October 22, 2010, 12:37:22 pm »

I'd like to announce a module i've hacked up for lighttpd that enables serving HTTP downloads to Quake 2 clients directly from PAK and ZIP archives, named mod_pak. This kind of setup is quite useful when the Q2 server and HTTP download server are running on the same machine there is no longer need to unpack everything and keep two copies of the data, wondering if they are synchronized or not. If the Q2 server supports loading of ZIP packs (.pkz), there is even more benefit mod_pak will serve all the data transparently compressed without any disk space and CPU time overhead.

Actual download server setup is quite trivial, here's an example of the smallest possible lighttpd.conf that can be run even by an unprivileged user account from the home directory:
Code:
server.document-root = "/home/quake2/pakserver/www"
server.port = 27980
server.modules = ( "mod_accesslog", "mod_pak" )
server.indexfiles = ( "index.html" )
server.pid-file = "/home/quake2/pakserver/pid"
server.errorlog = "/home/quake2/pakserver/error.log"
accesslog.filename = "/home/quake2/pakserver/access.log"
pak.search = (
    "/home/quake2/q2server/baseq2/pak0.pkz",
    "/home/quake2/q2server/baseq2/pak1.pkz"
)
#$HTTP["url"] =~ "^/foomod/" {
#    pak.search += ( "/home/quake2/q2server/foomod/pak0.pkz" )
#}
pak.content = "application/x-quake2-data"
pak.strip = 2
pak.referer = "quake2://"

For the description of mod_pak configuration parameters, downloads and building instructions and more please see the project page[1]. Currently mod_pak is distributed as a source patch to the latest stable lighttpd release.

[1]: http://skuller.net/modpak/
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: mod_pak serve HTTP downloads from PAK and ZIP (.pkz) archives
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines