Conecting to the lab

  1. From outside NUS, you will need to refer to the SoC-VPN Setup Guide, to setup your VPN connection.
    Note: I used the unsupported linux setup and additionally had to add nus.edu.sg as an Additional search domain, under IPv4 settings (for Ubuntu 12.04). Also, you have to authenticate at the the netlogon siteto maintain the connection.

Connecting to our server

For this course, your web space will live in a separate virtual machine. You can get to this machine via ssh. For example, under OSX or Unix, you can bring up a command prompt (or inside an xterminal), and ssh username@cp3101b-1.comp.nus.edu.sg From the lab, you can use putty, cygwin (but you have to install openssh), or SSH Secure Shell (the one we have in the lab). You can also googlessh clients to see other options from home. This is one typical way you would manage your web hosting account at godaddy, for example. Note: You are logging in using your sunfire account. If you forget it, you can reset it here.

Web setup in the lab

  1. Prepare your environment. On a lab machine... cd ~ chmod 711 ~ mkdir public_html chmod 711 public_html cd public_html
  2. Editing documents on the server. You have a few options. Probably the simplest is to edit documents locally (ie using notepad++) and then upload them to the server using scp (secure file copy). Other options include using a unix editor directly on the server. Options here include vi, vim, nano, emacs (not installed on the server yet).
  3. Creating your first webpage # create file index.html with contents ... <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Hello World</title> </head> <body> I am ID and this is my first webpage. </body> </html> # and get it into the server, in ~ID/public_html # check that the permissions are correctly setup ls -al index.html # -rw-r--r-- 1 arnold ssl-cert 44 Jan 9 00:35 index.html # if they are not set correctly, fix the files permissions by ... chmod 644 index.html # now view this in a browser at # http://cp3101b-1.comp.nus.edu.sg/~ID/index.html # where ID is your web server login. View your neighbours web page as well. # Go to http://validator.w3.org/ and validate your web page.
  4. <X> .... </X> is an element consisting of start tag <X> and end tag </X>
  5. Now review the P, H1, H2, H3, UL, OL, and IMG tags at w3schools and create an interesting document. See if you can include an image. To get you started, take a look at this document (view page source). Try to include an Anchor if you can (A tag).
  6. Make sure you set your new documents permissions properly.