DB Lab 1 - Learning the Server Environment

Overview

The purpose of this simple lab is to present the student the development envionment that we will be using for this class. We will learn THREE methods of interacting with the server, 1) SSH (putty) and 2) SCP, and 3) VNC. We will also get two simple demo program up and running.

The CS server

The CS server has address cs.mvnu.edu. It is a Ubuntu Linux server running on the server array in the Libaray. We will be using this to host our SQL Relational Database Server (mySQL), our web server, and the programs that we write in PHP, HTML, and SQL.

Each Student should have an account with you your email username as your username on the server. If you already had an account, the password will be what is was last year. if you are new to this server, your password will be you MVNU student ID. If so PLEASE change your password use the passwd command while logged in (more on that in a moment.)

On the server you will have a directory for your use at /home/students/username. (User your unsername). This is where you should store personal documents. However, files and programs you will make to interact with the web server need to be in the web tree. This is located at = /var/www/classes/csc3031/=. You will have a subdirectory there with your username. This is where ALL of your publically (web) avilable web documents and programs will need to be.

There is also class directory where I will place documents and programs I want you to use. This will be in /home/class/csc3031.

Logging in

On a lab computer, go to All Programs from the Start menu, and select WinSCP (directory), then WinSCP (program).

SCP Main Screen:
scpmain.png

This brings up a secure file transfer program. Enter in cs.mvnu.edu for host name, and your username in the username field. Finally enter your password into password field.

This brings up the file transfer window.

SCP File Screen:
SCPFile.png

Here you can see files on your local system on the left, and file on the CS server on the left. You can move files back and force merely by dragging them.

In practice, this is most of what we need for this course. We can simplly edit all your programs, scripts and web pages on our favoriate operating system, then copy them to the CS server to try them out.

PuTTY

PuTTY is a program that allows you to login to the server, and manipulate it using text commands. using it we can manipulate and edit files on the server to create and change the programs and web services we wish to use. If you want, you can create and edit your work using text editors like emacs, and move files around using commands like cp, rm, mkdir, etc, or you can use one of the solutions below.

Go to Commands, and select Open in PuTTY. Then login using the user name and password.

New Users:

  1. User your email username as your username.
  2. Use your ID as your password
  3. Change your password with the passwd command

  • PuTTY terminal program:
    Putty.png
However, it might be nice to get a FULL GUI access to the server. This can be done with VNC, a remote desktop program.

VNC

In order to access the server with a full GUI interface, we first need to start a personal workstation client on the CS server just for our use. We MUST do this with a terminal interface like PuTTY above. What we need to do is to type in vncserver at the command prompt. This will ask us for a password (the first time), which is used to protect your virtual serve from others users. Simply enter a password you will remember. The system will then give you a number (a integer) which you MUST remember to access you server.If you are not prompted for a password, use the vncpasswd command as seen below.

vncPuTTY.png

Download VNC Java client at: http://www.tightvnc.com/download.php. Double click to run.

You can now run the VCN program in the system menu. This will for for the name and port number of the system you wish to connect to. Enter "cs.mvnu.edu:59xx" where xx is the integer number of your server (if xx<10, put a zero ahead, e.g. cs.mvnu.edu:5902)

You will then be prompted for the password you just made up, enter it now (you didn't forget, right?)

Ubuntu on VNC:
UbuntuStart.png

From here you can edit (using a nice GUI editor like gedit).

***Note - you cannot directly use VNC from you dorm, or off campus. This is because the ports are blocked for enhanced security. Use this dcoument to work from your dorm or off campus: UsingVNCwithTunnel.docx

Getting your first PHP program operational

Step 1

In the terminal program to do a cd /var/www/classes/csc3021 This is where you will place file for web browser access (this is "in" the www file tree).

Create a folder for your work using mkdir username , where username is your login name. This creates the directory for your use.

Step 2

Copy the files in /home/students/csc3031 to some place you can work with them, and then to your web directory just created. You have three options here:

  1. Use scp to first copy the files in /home/students/csc3031 to you local computer. Then copy the .php and .html files to /var/www/classes/csc3021/username (where username is your username).(Do NOT copy the Makefile!)
  2. Use the Linux file browser in VNC to copy and paste from one location to the other. (e.g. from /home/students/csc3031 to your directory /home/students/username/lab1. (You should create a NEW folder for EACH assignment). You can then enter into the subdirectories to and use the "make" command to move the files to /var/www/classes/csc3021/username). Edit the Makefile files to use your username first!
  3. Use the Linux cp command to copy the files to your home directory. Edit the Makefile to use your username. Then use make to push the files out to your web directory (This is for more advanced, non-GUI users!)

Step 3

Try it out! In a browser go to http://cs.mvnu.edu/classes/csc3031/. Select your directory. Then try the two .html files!

Step 4

Edit the 4 files (two .html and two .php file) to add at least 2 products to each, and to change the headers to personalise it for you.

Turn in your results

On Moodle, turn in a link to your two modified programs.

-- JimSkon - 2011-09-09

Topic attachments
I Attachment Action Size Date Who Comment
Pngpng FolderTree_.png manage 22.0 K 2013-11-15 - 12:59 JimSkon  
Pngpng Putty.png manage 17.3 K 2011-09-12 - 03:12 JimSkon PuTTY terminal program
Pngpng SCPFile.png manage 63.0 K 2011-09-12 - 02:45 JimSkon SCP File Screen
Pngpng UbuntuStart.png manage 50.2 K 2011-09-12 - 03:33 JimSkon Ubuntu on VNC
Pngpng VNCServer.png manage 25.2 K 2011-09-12 - 03:28 JimSkon VNC Startup
Pngpng scpmain.png manage 16.8 K 2011-09-12 - 02:38 JimSkon SCP Main Screen
Pngpng vncPuTTY.png manage 23.9 K 2011-09-12 - 14:42 JimSkon Starting VNC from PuTTY
Topic revision: r6 - 2013-11-15 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback