210 likes | 419 Views
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
E N D
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
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"
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
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
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
CGI "Scripting" Languages • interpreted • UNIX shell scripts (like DOS bat files) • Perl, Python and PHP • other scripting languages • compiled • C/C++ programs • other executables
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
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 ->
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)
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)
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
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%
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
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?
Implications of Log Data? • page design • good pages, bad pages • types of customers • keywords to emphasize in page content • marketing techniques • referring pages
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?
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
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
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
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?