So you want your personal home page at http://www.phys.ethz.ch/~your_user_name/?
Note: ${HOME} refers to your home directory on the D-PHYS servers. This is automatically available on the managed workstations (either ${HOME} on Linux and OSX, or the H: drive on Windows). For self managed workstations read [how to use the fileservers].
Here's how to get it working:
As example, we will create a password protected subdirectory “foo” for the user “johndoe” at http://www.phys.ethz.ch/~johndoe/foo/. There will be two users with access: One will be “bar” with password “foobar”, the other will be “fnord” with password “gna”. Change those values appropriately for your case.
mkdir ${HOME}/public_html/foo
It cannot be a symbolic link to somewhere outside the public_html directory.
AuthType Basic AuthName "This directory is password protected" AuthUserFile /public/johndoe/foo/.htpasswd require valid-user
htpasswd -b -c ${HOME}/public_html/foo/.htpasswd bar foobar
(You may also ommit the ”-b” parameter and the password. Then you have to type it twice and blindly afterwards. The ”-c” parameter is only needed the first time to create the ”.htpasswd” file.)
chmod 644 ${HOME}/public_html/foo/.ht*
otherwise the webserver won't have access to those files. Again, if you have your home directory unaccessable for others, they won't get access, even if they know the location of those files. The webserver won't give them out either, even not with password.
htpasswd -b ${HOME}/public_html/foo/.htpasswd fnord gna
(You may also ommit the ”-b” parameter and the password. Then you have to type it twice and blindly afterwards.)
See http://httpd.apache.org/docs/2.2/howto/auth.html for the gory details and further documentation.