Background
I have a web page X
, which I would like to serve through only through URLs matching /X/${UUID}
, where UUID
is a random UUID which I give to a person. I have come up with a solution which involves creating symbolic links from directory outside of the web root to a directory with name ${UUID}$
inside the web root.
Approximate Solution
- Define
WEB=/Users/jpcooper/Web
. mkdir $WEB/internal
mv index.html style.css script.js $WEB
.mkdir -p $WEB/root/X
.cd $WEB/root/X; ln -s ../../internal ${UUID}
.
lighttpd.conf
:
server.document-root = "${WEB}/root"
server.follow-symlink = "enable"
index-file.names = ( "index.html" )
mimetype.assign = (
".html" => "text/html",
".css" => "text/css",
".js" => "text/javascript"
)
Lighttpd will now expose only the urls of the form /X/${UUID}
.
Improvement?
Is there any better way of registering UUIDs somewhere and having URLs of the form /X/${UUID}
proxied to the ${WEB}/internal
directory? Can this be done without CGI?