How to get a personal homepage

So you want your personal home page at http://people.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 OS X, or the H: drive on Windows). For self managed workstations read how to access the fileservers.

Here's how to get it working:

Creating the homepage

Short description for Linux and Mac command line users

mkdir ${HOME}/public_html
chmod 755 ${HOME}/public_html
$EDITOR ${HOME}/public_html/index.html
$BROWSER http://people.phys.ethz.ch/~your_user_name/

General description (e.g. for Mac, Windows, KDE or GNOME users)

  • Create a directory public_html in your home directory (this is the directory /home/your_user_name/ with your_user_name replaced by your user name. It is not your desktop neither the directory /home/)
  • Make it at least world accessible. You home directory does not need to be world accessible or readable though.
  • Create a file called index.html in that newly created directory and put some HTML in it. See http://de.selfhtml.org/ for a good, easy to understand and though comprehensive HTML documentation in German.
  • Point your favourite web browser to http://people.phys.ethz.ch/~your_user_name/. (Please note that you will get a "Permission denied" error if you didn't create an index.html file beforehand.)

Making a homepage subdirectory password-protected

As example, we will create a password protected subdirectory "foo" for the user "johndoe" at http:s//people.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.

  • Create the directory, if it doesn't exist. It must be somewhere under the public_html directory, e.g. with mkdir ${HOME}/public_html/foo. It cannot be a symbolic link to somewhere outside the public_html directory.
  • Create a file with name .htaccess in that directory with the following content:
AuthType Basic
AuthName "This directory is password protected"
AuthUserFile /public/johndoe/foo/.htpasswd
require valid-user
  • Execute the following command on one of our managed Linux workstations: 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.)
  • Make sure, the .htpasswd and .htaccess files are world-readable, e.g. with 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.
  • If you want to add additional users, additionally execute the following command on one of our managed Linux workstations: 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.

FAQ

What happened to http://www.phys.ethz.ch/~my_user_name/?

The main website of the Department of Physics moved to a different, ETH-wide CMS.

This system doesn't have a personal homepage feature - hence it became necessary to move the D-PHYS personal homepages to a host name different from www.phys.ethz.ch. We've chosen people.phys.ethz.ch for that.

Will my old homepage addresses continue to work?

Yes.

The redirects which are already in effect will continue to exist after the move to the new hosting.