cis 451: servers, cgi and log files dr. ralph d. westfall january, 2009

21
CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Upload: charlotte-atkins

Post on 27-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

CIS 451: Servers, CGI and Log Files

Dr. Ralph D. WestfallJanuary, 2009

Page 2: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Server Functions deliver files to users manage files that users are

requesting example: "could not be found."

server side processing run ASP, PHP and CGI scripts write and/or read databases

search engines shopping carts customer services e.g., for credit card accounts

Page 3: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Server Functions-2 security

owner: can write or delete files on server user has:

read access to html files execute access to "script" files maybe password-protected access to

files

tracking activity "log files"

Page 4: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Server Options your own server at your location

phone DSL, T1, cable connection, etc. colocation: your server at their location

high speed access to nearby Internet node you are responsible for technical issues

hosting: their server at their location host takes care of most technical issues

Page 5: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Popular Server Software Windows Server 2008 (humor) Apache

has some technical advantages is free (open source like Linux) has largest share of market (52%) is the server on Cal Poly Intranet LAMP: Linux, Apache, MySQL, PHP

Page 6: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

CGI Common Gateway Interface (CGI)

is a standard for interfacing applications with servers

is what people used before ASP CGI applications are triggered by users'

inputs from browsers provides capabilities that HTML

doesn't database read and write complex calculations/data manipulation security

Page 7: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

CGI "Scripting" Languages interpreted

UNIX shell scripts (like DOS bat files) Perl, Python and PHP other scripting languages

compiled C/C++ programs other executables

Page 8: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

CGI on a Search Engine browser requests URL from server

http://www.google.com/search?q=free server runs the requested script script calls program to access

database database returns data to a script script writes data into a web page server sends this page to browser

Page 9: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Passing Information to CGI essentially same as for HTML form

sending data to ASP.NET <form action="cgi-bin/script.pl"

method="get"> "get" appends data to URL (URL encoding) .pl is common extension for Perl files

<form action="cgi-bin/script.pl" method="post"><!- different route ->

Page 10: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Using CGI Scripts server must allow you to run scripts

poorly written scripts vulnerable to hackers load script in appropriate directory

usually /cgi-bin set permissions (Cal Poly) so file is executable

chmod 755 (read and execute) in UNIX (right click on file or directory in WS_FTP)

may also need to set write permissions for data files (put them in a different directory)

Page 11: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

ASP vs. CGI Scripts ASP much easier to use (.NET less so) ASP is growing faster ASP is less powerful (.NET better) not all ISPs offer ASP capabilities

UNIX servers need additional software to run ASP or ASP.NET

market pressures on ISPs to offer ASP (almost always through IIS, not Apache)

Page 12: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Server Log Files HTTP offers extensive capabilities

for tracking users/site visitors HTTP logging stores information

when file requested browser name/version referring URL (where user came from)

search engine key words to find your site

user's IP address

Page 13: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Logging Terminology hits (# of files requested) vs.

visitors impressions (CPM)

how many visitors possibly adjusted for length of visit

("stickiness" of site) click-throughs

CTR (click-through rate) average "click rate" is less than 0.5%

Page 14: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Log File Analysis Reports how long visitor stayed on page and site most popular visit times referring URL which page on your web site visited first page that went to from your web site country (2 characters ending on IP

address) .ca=Canada, .fr=France, .kr=Korea

Page 15: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Free Log File Analysis Services Webstat (free),

cut and paste JavaScript into your site adds a small logo

provides extensive statistics current month historical

GoStats eXTReMe Tracking most popular free?

Page 16: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Implications of Log Data? page design

good pages, bad pages types of customers

keywords to emphasize in page content

marketing techniques referring pages

Page 17: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Exercise 1a search for log file analysis software

or services post discussion list report on findings

number of free, cost range for not free? free vs. not free reports available? other useful features? web-based or need to install on own

server?

Page 18: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Exercise 1b sign up for free hit counter/log

analysis and install it on one of your web pages

post discussion list report ease of use information requested (# of boxes to fill

in, # of pages to complete sign-up) how good were the installation

instructions any other issues

Page 19: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Income from Web Advertising impressions

CPM (cost per 1000) typical rates $10 - $30/1000 visitors

need to have at least 10,000 visitors/month click-throughs commissions on sales, e.g. Amazon

up to 15% on sales of specified items other "affiliate programs" (link) web income calculator

Page 20: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Exercise 2 search for information on affiliate

programs find one that looks either very bad

or very good look for: rip-offs, outrageous scams,

etc. post discussion list report

reason it was bad or good product, payment scheme other issues

Page 21: CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009

Exercise 3 find a map that shows locations of

major Internet nodes needs to show in relation to an

understandable map or find a list of names of cities that

have major Internet nodes are these hard to find?

why?