Unsorted Notes

Setup of a homepage on KTH's webserver

The article describes how to setup a homepage at KTH.

The homepage will be served from the sub-directory public_html of the user's home directory that is located in the OpenAFS cell kth.se There are two options to access it.

The path to the home directory in OpenAFS has to be found in case that it is not known yet. Furthermore, one needs Kerberos tickets and OpenAFS tokens for the cell kth.se.

Getting kerberos tickets and OpenAFS tokens for the cell kth.se

The user nisse could acquire tickets and tokens with the following commands:

$ kinit nisse@KTH.SE

The command klist -Tf will show for example to a PDC user that he now owns tokens for the OpenAFS cells pdc.kth.se and nada.kth.se. The tokens for kth.se can be fetched with the command:

$ afslog kth.se

Find the home directory of a user in the OpenAFS cell kth.se

Now needs nisse to find his home directory in the cell kth.se. This can be done with the following two commands.

# Change to the grand-parent directory of nisse's home.
# Its name is the first letter of the user name, for nisse therefore
$ cd /afs/kth.se/home/n

# Now search the user's home. Nisse uses
$ find . -maxdepth 2 -type d -name nisse
./h/nisse

Manage the homepage data

Change to the directory of the homepage and edit files there, copy data etc.

$ cd /afs/kth.se/home/n/h/nisse/public_html

Of course, you have first to acquire kerberos tickets and OpenAFS tokens as described above to access your data if you come back later.

Redirect to the new place

Finally one could wish to redirect visitors to the new location if the page was previously located at another server already. This can be realised in different ways.

One single 301 redirect is needed in case of a simple move, i.e. if the page will placed onto the new server with the same internal structure as before. To do that create a file .htaccess in the root directory of the old homepage and specify the new target:

Redirect 301 /~nisse/ http://people.kth.se/~nisse/


2014-09-13 – Category: kth – Tags: systems