apacheopenbsd

How do I configure a Tilde Server on OpenBSD Httpd?


I would like to set up a tilde server on the OpenBSD httpd daemon.

If I have a user, foobar for example, I would like clients to see his home directory when they navigate to https://example.com/~foobar.

foobar would ssh to my server and then put his HTML files in /home/foobar/public_html.


Solution

  • Since OpenBSD's httpd server will not follow Symlinks, do a Symlink the other way.

    Create directories, for example, in /var/httpd for each user and give the user ownership:

    $ sudo mkdir /var/httpd/\~foobar
    $ sudo chown -R foobar /var/httpd/\~foobar 
    

    Then, have each user symbolic link the above directory to their own public_html:

    (foobar)$ ln -s /var/httpd/\~foobar ~/public_html
    

    When they put files in public_html, httpd will serve them.