I have thttpd up and running and everything seems to be working fine. It's only accessible from behind my firewall now, but it is definitely a breeze to get working. I have been following
this setup guide which is done using NetBSD as the OS.
Things didn't happen exactly the same way installing on Debian, but I was able to follow exactly what was happening differently at each step along the way until the final security check. I think the chroot is working correctly, but I'd like to be able to duplicate this (fstat) command.
From the article:
Quote:
...tell the daemon to chroot itself into the documents' root directory after startup. This is easy to do on NetBSD by passing the -r flag to the daemon. With this in mind, modify /etc/rc.conf:
# cat >>/etc/rc.conf
echo thttpd=YES
echo thttpd_flags=-r
^D
|
The rc.conf function seems to be handled in Debian by /etc/init.d/thttp.d ... but all it does is start the server. The chroot is apparently handled in /etc/thttpd/thttp.conf file with the single command "chroot."
Back to the article:
Quote:
...make sure that the -r flag was effective ... with help from the fstat command, whose purpose is to show the status of all open files. Search for the root file used by the daemon:
# fstat | grep ^thttpd | grep root
thttpd thttpd 1206 root /home 2351520 drwxrwxr-x 512 r
What the output shows is that the command is being executed under the directory pointed to by the 2351520 inode, living under the /home filesystem (which is a separate partition).
|
For me, that command returns, "bash: fstat: command not found"
Interestingly, "man fstat" returns information on a "stat" command which seems to include fstat, but I can't figure out how to make it work. "aptitude install fstat" doesn't find the program.