Easy URL to this page http://homepage.ux.uis.no/

Your own home page

When you got your Unix user account, a sample home page where created for you (if it wasn't run the command homepage-init), making it a little bit easier for you to get started building your own home page or just experimenting with HTML code.

Your Unix account

Your Unix account, your own private directory or folder if you like, also known as HOME, is located on a central Unix fileserver (to be precise the fileserver is a GNU/Linux system running the Scientific GNU/Linux distribution, but we use "Unix" as a common name or alias for all our different UNIX or "Unix-like" operating systems, like GNU/Linux, HPUX and Solaris). The path to your HOME is either /home/stud/"username" or /home/ansatt/"username", depending on wheter your are a student or an employee.

Lets take a student, with user name "kari", the address (or URL) to Kari's home page would be http://www.ux.uis.no/~kari. When you enter this URL in your web browser, it will contact the web server at www.ux.uis.no asking for user kari's home page (the tilde, "~", tells the server that the following is a user name). The web server will look for a index.html file in Kari's "public_html/" directory in her HOME. For this to work, the web server must have access to all of the directories leading up to the html file. The full path to the index.html file is /home/stud/kari/public_html/index.html. If kari at some point removes the web server's access to her HOME, to her public_html direcory or to the index.html file, her home page will be unavailable (which may or may not be what she wanted).

Unix file permissions

You could skip this, if it just work, but when you start tinkering it may break, so read on. smile

If you delete the sample index.html file, make sure the new one you create has read (r) file permission for the other group. If not, the web server is unable to read your index.html file and your home page won't work.

Follow this link and, at least read the "Unix Permissions" section, you should also understand the chmod command, so read that section too. You may also want to have a look at the File security section in the book Introduction to Linux.

To fix the file permissions, login with SSH (secure shell) and use the command chmod o+r public_html/index.html (o=other, r=read) assuming your working directory (wd) is your HOME (which it usually is, right after login). If not, change the wd to your HOME with the command cd (change directory). Alternatively you could enter the public_html directory first, with cd public_html and then execute chmod o+r index.html. Or you could give the web server access to all files in the public_html directory, with the command chmod o+r public_html/*.

Steps to open or close access, for the web-server, to your home page

To open home page To close home page
  1. cd
  2. chmod o+x .
  3. chmod -R o+rx public_html

  1. cd
  2. chmod o-x .
  3. chmod o-rx public_html

To make it a little easier, you could use the shell scripts homepage-open and homepage-close instead.

Editing index.html

There is nothing wrong, off course, with editing the index.html file directly, by login to one of the Unix servers. But the easiest way, for most, would be to create the index.html file (and other HTML files) on your own PC's, with your favorite editor, and then upload them to the public_html directory. Uploading files is easy and can be done from where ever a usable Internet connection is available (a usable Internet connection is a connection where SSH traffic isn't being blocked, as it is in some public places). Windows users could use the Secure File Transfer utilities, GNU/Linux and Mac users could use one of the commands SCP (Secure copy) or rsync or just use a graphical tool included in the GNU/Linux and MAC OS to upload files.

Another option is to use SSHFS. This enables you to mount your public_html/ directory (or your HOME) as a local disc drive, really making it easy to edit and change files in your public_html directory.

The shell script homepage-init, will (re)install the sample index.html file (overwriting you index.html file if you allready have one).

Validating your code

Unfortunately web browsers, and especially the most common one (Explorer), are a bit too smart and will correct HTML coding errors. The reason this is bad is that home pages have been, and still are, being built and tested only with the Explorer browser. The consequence is that many pages out there contains error and will not work correctly in other browsers.

The lesson to be learned is to always validate you HTML code with a validator, like the ones at w3.org or htmlhelp.com If this is a bit to much for you (you big sissy! :-)), you should at least test your pages with a couple of the most popular browser (ex. Amaya (w3.org), Chrome, Firefox, Konqueror, Opera).

HTML reference

HTML info pages The “rest” of the HTML info pages out there... Good luck!
Topic revision: r8 - 2010-11-01, TheodorIvesdal
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback