CPS 116 (Fall 2008):
Introduction to Database Systems

Course Information   Lecture Notes   Assignments   Tentative Syllabus   Programming Notes   Blackboard (Grades)
Getting Started with cps116 Server   Getting Started with Gradiance   DB2 SQL Notes   Using ra   JDBC Notes   Tomcat Notes   XML Notes

Getting Started with cps116 Server


Index


General information

Most of the programming work in this course can be completed on cps116.cod.cs.duke.edu, which is a Linux server running the IBM DB2 database server. Please be considerate in using this server since it is shared by all students in CPS116 and CPS216. Refrain from running anything unrelated to the course. Quit all your applications and log out after using the server (in the past, we have found idle XEmacs processes to be the top culprit in server slowdowns). If something terminates abnormally, kill any runaway process manually (e.g., J2EE application servers, if not shutdown properly, can leave dozens of Java virtual machines running). You can see what processes you have currently running using the Unix command "ps f", and you can kill a process with pid using "kill -TERM pid" (or if that does not work, "kill -KILL pid"). To kill all your processes, try "kill -KILL -1" (which will also log you out).


Logging in and out

In the following, your "work computer" refers to the machine from which you access cps116.cod.cs.duke.edu remotely.

Use your favorite SSH client to log into cps116.cod.cs.duke.edu remotely. For example, if your work computer is a Unix/Linux or Mac machine, run the following command (replace user below with your cps116 account name) from your Unix/Linux shell or Mac terminal:

ssh cps116.cod.cs.duke.edu -l user
If your work computer runs Windows, you can use SSH.com's SSH client, which can be downloaded here from Duke OIT. Other SSH clients are also okay.

After logging in, you should be inside your cps116 login shell, which is bash by default. If this is the first time you log in, remember to type the Unix "passwd" to change your default password to something more secure. After you are done using cps116, remember to log out using the Unix "exit" command.


Advanced SSH setup

You need to use advanced SSH setup if any of the following applies: (1) You would like to launch X windows applications (such as firefox and emacs) from cps116 and use them from your work computer. (2) For security reason, access to most of the ports on cps116 has been blocked. However, you would like to host your own services (such as Web servers) on cps116, which must be accessed through these blocked ports.

To perform the SSH setup, follow the appropriate instructions below.

If you use OpenSSH

OpenSSH is usually available by default on Linux/Unix or Mac machines. It is the command ssh that you run through the command-line interface of a Linux/Unix shell or Mac terminal.

  1. Log into cps116, and run the command "/home/dbcourse/bin/gen-my-ssh-config.sh > ~/cps116-ssh-config". This will create a file containing SSH configuration information in your home directory on cps116. Log out.
  2. From your work computer shell/terminal, run the command "scp user@cps116.cod.cs.duke.edu:cps116-ssh-config ~/", where user is your cps116 account name. This command will copy the SSH configuration file you created from cps116 to your work computer.
  3. From this point on, to log into cps116 from your work computer shell/terminal, run the command "ssh -F ~/cps116-ssh-config cps116.cod.cs.duke.edu". The extra option tells ssh to set up X11 forwarding and appropriate tunneling.
    To see how what default tunnels have been set up for you in cps116-ssh-config, run the command "/home/dbcourse/bin/show-my-ports.sh" on cps116. There is no need to change the default settings unless you want to run other services not supported by the course staff. If you do, please take a note of the range of ports reserved for you (shown at the beginning of the output from show-my-ports.sh). Do NOT run services outside this range as it may conflict with the services run by your classmates.

If you use SSH.com's SSH client

SSH.com's SSH client can be downloaded here from Duke OIT. Instructions below may apply to other SSH clients too, with little modification (F-Secure, for example, calls "outgoing tunnels" "local" instead).

  1. Log into cps116, and run the command "/home/dbcourse/bin/show-my-ports.sh". Take a note of the default settings (you might want to copy then down to a piece of paper). A typical line of default settings looks like the following:
        ServiceName    LocalPort    PortOnCPS116
    
    There is no need to change the default settings unless you want to run other services not supported by the course staff. If you do, please take a note of the range of ports reserved for you (shown at the beginning of the output from show-my-ports.sh). Do NOT run services outside this range as it may conflict with the services run by your classmates.
  2. Go to "Edit->Settings", and find the setup for "Tunneling". For each line above, add an "Outgoing Tunnel" as follows (replace ServiceName, LocalPort, and PortOnCPS116 with appropriate values from the line):
    • Display name: ServiceName
    • Type: TCP
    • Listen Port: LocalPort
    • Destination Host: cps116.cod.cs.duke.edu
    • Destination Port: PortOnCPS116
    Also, find the setup for "X11 tunneling", and choose to tunnel X11 connections. When you are done with the setup, go to "File->Profiles->Add Profile", and add the profile with name cps116. Finally, go to "File->Save Settings" to save your setup.
  3. From this point on, to log into cps116.cod.cs.duke.edu using your SSH client, simply choose the connection profile cps116, and X11 forwarding and appropriate tunneling will be set up automatically for you.

Reporting problems

Send email to Jun (junyang@cs.duke.edu).

Last updated Mon Aug 25 14:18:21 EDT 2008