Introduction to Web Site Development

Matt Mahoney, mmahoney@cs.fit.edu

www.cs.fit.edu/~mmahoney/cse4232/web


What you need to know to set up a web site


Web Services

Dial-up Account

Web Server Account


UNIX

Unix file system

Start web server: /etc/httpd/httpd &

Edit Joe’s home page: vi ~joe/public_html/index.html

List CGI scripts: cd /etc/httpd/cgi-bin; ls -las

1  drwxr-xr-x  nobody  .           Apr  4
1  drwx--x--x  root    ..          Dec 12
3  -rwxr-xr-x  joe     getmail.pl  Oct  2

Networks

Layered network model

4 layer network model

Application-level services

Service Client Protocol TCP port
Web netscape, explorer, ... HTTP 80
Forward mail sendmail SMTP 25
Receive mail mail, ... POP
Remote login telnet, rlogin, rsh telnet 23
Transfer files ftp FTP 20, 21
Host name = IP address resolver, nslookup DNS
USENET rn, ... NNTP 119
Test host/network ping ICMP

Try this:

telnet www.fit.edu 80
GET /index.html

Example HTTP session captured with Snort.


Web Servers

UNIX Servers

Directory setup

Configuration

Logs


Web Client History


Protocols

Parts of a URL


Name:
Email:
Check here:

Data is received by test.pl on ice.he.net in /cgi_bin

mailform.pl would mail the information to you. Use <form method=POST>

Other URL protocols


HTTP Protocol

HTTP Protocol

File Type MIME Type Viewer/Plugin
.html, .htm text/html
.gif image/gif
.jpeg, .jpg image/jpeg
.pdf application/pdf acrobat
.ps application/postscript ghostview
.gz application/x-gzip gunzip
.Z application/x-compress uncompress
.zip application/x-zip unzip, pkunzip
.ra, .ram audio/x-pn-realaudio realaudio
.qt, .mov video/quicktime quicktime


HTTPS Protocol

Encrypted transfers to prevent interception at intermediate hosts. Netscape displays a blue border and solid key.

HTTPS Protocol


HTML Examples

After viewing each page, click on View/Source in your browser to examine the HTML.


Cookies

#!/usr/bin/perl

# Read the cookie
$cookie = $ENV{HTTP_COOKIE};  # "name=Matt;"

# Write a cookie
print "Content-type: text/html
set-cookie: name=Matt; expires: Sat Jan  1 00:00:00 2001;

<HTML> etc...";

# Read other useful data
$host = $ENV{REMOTE_HOST};  # "net2-209.ix.netcom.com"
$addr = $ENV{REMOTE_ADDR};  # "218.83.2.209"

\windows\cookies directory (Internet Explorer) or \program files\netscape\navigator\cookies.txt (Netscape)


JavaScript

JavaScript CANNOT

Javascript CAN

Javascript 1.1 (Netscape 3.0, IE 4.0)

Examples

Use View/Source in your browser to see the JavaScript source code.


Continue to next section (Java)