D. J. Bernstein
Internet publication

How to install publicfile

Like any other piece of software (and information generally), publicfile comes with NO WARRANTY.

System requirements

publicfile works only under UNIX.

publicfile uses ucspi-tcp to handle incoming HTTP and FTP connections. Before installing publicfile you need to install ucspi-tcp 0.83 or above. Make sure that the ucspi-tcp programs are in your system's default path.

publicfile uses daemontools to start, monitor, and control the HTTP and FTP services. Before installing publicfile you need to install daemontools 0.61 or above. Make sure that the daemontools programs are in your system's default path.


Download the publicfile package. The latest published publicfile package is publicfile-0.52.tar.gz.

Unpack the publicfile package:

     gunzip publicfile-0.52.tar
     tar -xf publicfile-0.52.tar
     cd publicfile-0.52

Compile the publicfile programs:


As root, install the publicfile programs in /usr/local/publicfile:

     make setup check


publicfile uses two system accounts. The httpd and ftpd programs run (chrooted) under one account, typically called ftp. Logging programs run under another account, typically called ftplog. Decide what account names you want to use, and create the accounts now.

publicfile relies on svscan to start it and to restart it at boot time. Your boot scripts should already be running svscan in a /service directory.

publicfile needs to know which host names to treat as local names for HTTP. Make a list of acceptable names, all in lowercase: e.g., www.heaven.af.mil and www. You should also include your IP address if you want to allow that in URLs: e.g.,

publicfile makes files available from a public file area inside a new directory hierarchy, typically called /public. Decide what hierarchy name you want to use, and create the hierarchy with your selected host names by running the configure program (all on one line):

     /usr/local/publicfile/bin/configure ftp ftplog /public www.heaven.af.mil www
Finally, tell svscan about the HTTP and FTP services:
     ln -s /public/httpd /public/ftpd /service
svscan will start the services within one minute.


Try some automatic tests:
     ./rts > rts.out
     cmp rts.out rts.exp
Normally this prints nothing.

Create a world-readable /public/file/0/index.html, and try accessing it with your favorite HTTP and FTP clients.

Check the status of the HTTP and FTP services:

     svstat /service/httpd /service/ftpd
     svstat /service/httpd/log /service/ftpd/log
     head -1 /service/httpd/log/status /service/ftpd/log/status

To report success:

     ( echo 'First M. Last'; cat `cat SYSDEPS` ) \
     | mail djb-qst@cr.yp.to
Replace First M. Last with your name.