Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How the Web Works: Lecture 7
Search
Abhinav Sharma
January 09, 2014
Education
0
45
How the Web Works: Lecture 7
This talk was designed for a class (98-135) taught at Carnegie Mellon University in Spring 2010.
Abhinav Sharma
January 09, 2014
Tweet
Share
More Decks by Abhinav Sharma
See All by Abhinav Sharma
How the Web Works: Lecture 5
abhinavsharma
1
73
How the Web Works: Lecture 6
abhinavsharma
0
47
How the Web Works: Lecture 8
abhinavsharma
0
110
How the Web Works: Lecture 9
abhinavsharma
0
63
How the Web Works: Lecture 3
abhinavsharma
0
35
How the Web Works: Lecture 2
abhinavsharma
1
46
How the Web Works: Lecture 1
abhinavsharma
2
120
Other Decks in Education
See All in Education
登壇未経験者のための登壇戦略~LTは設計が9割!!!~
masakiokuda
3
660
仮説の取扱説明書/User_Guide_to_a_Hypothesis
florets1
4
380
シリコンバレーでスタートアップを共同創業したファウンディングエンジニアとしての学び
tomoima525
1
1.1k
RSJ2025 ランチョンセミナー 一歩ずつ世界へ:学生・若手研究者のための等身大の国際化の始め方
t_inamura
0
280
バックオフィス組織にも「チームトポロジー」の考えが使えるかもしれない!!
masakiokuda
0
120
生成AI活用セミナー/GAI-workshop
gnutar
0
110
Présentation_1ère_Spé_2025.pdf
bernhardsvt
0
200
令和政経義塾第2期説明会
nxji
0
200
2025年度春学期 統計学 第10回 分布の推測とは ー 標本調査,度数分布と確率分布 (2025. 6. 12)
akiraasano
PRO
0
220
~キャラ付け考えていますか?~ AI時代だからこそ技術者に求められるセルフブランディングのすゝめ
masakiokuda
7
460
大学院進学について(2025年度版)
imash
0
120
Common STIs in London: Symptoms, Risks & Prevention
medicaldental
0
140
Featured
See All Featured
A better future with KSS
kneath
239
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Practical Orchestrator
shlominoach
190
11k
Producing Creativity
orderedlist
PRO
347
40k
Scaling GitHub
holman
463
140k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Context Engineering - Making Every Token Count
addyosmani
1
28
Git: the NoSQL Database
bkeepers
PRO
431
66k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Transcript
None
http://www.youtube.com/watch?v=qYodWEKCuGg
Welcome Back!
Logistics Homeworks + Remaining Course
Homeworks Bad News =( The Project Idea Failed Minis are
now Homeworks Still cover everything Just no project experience However...
Lecture 7 Webmasters’ World Putting it all together
None
Domains Popular: .com .net .org Reserved: .gov .edu .mil National:
.us .in .cn .ru Cost around $10 a year Controlled by ICANN Internet Real Estate
Insure.com $16 million Sex.com $14 million Fund.com $10 million Porn.com
$9.5 million Business.com $7.5 million These are just the names, not the existing business
Domain Squatting Money for early movers! Registering trademarks is illegal
Parking Pages Aftermarkets (TDNAM.com) But in my experience...
Parking Sedo.com Namedrive.com
More Recently... Google knows to ignore them Smarter parked websites
Content Management Systems Social Networking Site Forum, Wiki, etc..
Forums for Domainers Namepros.com Dnforum.com
Where to Buy? DomainSite.com | GoDaddy.com | Name.com | Others...
Web Hosting
Where do I go?
Self Managed Managed Complete Control Comes with PHP/SQL/... “Lower” Costs
Monthly Cost Upgrade, Backup Auto Upgrade/Backup Enterprises You and Me
Free Paid Costs Nothing Around $100/yr Low Storage (~1GB) High
Storage (~1TB) Low Bandwidth High Bandwidth Good for starting off If you have a bunch of sites x10hosting.com, etc... dreamhost.com, etc...
Where to Buy? GoDaddy.com | Dreamhost.com | etc...
DNS Essentials NS: Name Server Where the domain is hosted
MX: Mail Exchange Server that handles email CNAME: Canonical Name foo.me.com -> bar.me.com Mostly use NS, controls rest
Quick Demo Propagates across the web, can take hours!
www.cmuwebworks.com/movies/domain_hosting.mov
Useful Tools ... and I mean really, really useful!
FTP File Transfer Protocol Move files to/from server Windows/Linux: FileZilla
Mac: Cyberduck
SSH Secure Shell Control Server from Home Remember from C@CM?
Awesome for Batch Tasks Learn about Shell Scripts
Crontab Run shell scripts periodically 1. Create a cron.txt file
2. Upload cron.txt 3. Set file: “crontab cron.txt” Format for cron.txt
min hour month day weekday cmd 30 23 * *
* php script.php 30 23 * * 0 php script.php * 1,2 * * * php script.php 30 23 * * 1-5 php script.php http://adminschoice.com/crontab-quick-reference
Quick Demo Setting Up a Cron Job
www.cmuwebworks.com/movies/crontab.mov
MOD Rewrite Not your grandma’s URLs
Typically, URLs match directory structure
mod_rewrite Is a module in the Apache server That manipulates
URLs Uses rules (regex) to manipulate URLs www.website.com/get/cake actually www.website.com/g.php?v=cake ... super useful with dynamic pages! Search Engine Friendly URLs .htaccess file | Demo
None
Demo http://www.cmuwebworks.com/show.php?val=123 to http://www.cmuwebworks.com/show/123
www.cmuwebworks.com/movies/mod_rewrite.mov
MVC Model-View-Controller Pattern
It works, but what’s wrong?
Functionality CS Major Styling Designer Templating The Unlucky Guy One
File!
Scale to Survive | Need Efficient Design Patterns How we
did it MVC
GET index.php
GET Controller Return Model Fetch Data View Put Data in
Template
Return I still get the exact same thing, awesome!
Implementation Rails for Ruby, Django for Python CakePHP, CodeIgniter for
PHP controllers/ models/ views/ Controllers: PHP file, does work Models: Classes fetch Data (SQL) Views: Render Data from Controller
CodeIgniter’s a popular PHP based MVC framework http://www.codeigniter.com/videos/intro.mov
None
None
http://codeigniter.com/wiki/mod_rewrite/
One More Thing Managing Data
Year Leader Minion 2008 Obama Biden 1944 Roosevelt Truman 1940
Roosevelt Wallace Person Age Truman 50 Wallace 60 Obama 70 getOlderMinion($lead) class Race { getPresidents(); getPrez($year); // ... }
Year Leader Minion 2008 Obama Biden 1944 Roosevelt Truman 1940
Roosevelt Wallace class Race_Model { }
class Race_Model { $year = 0 $leader = ‘’ $minion
= ‘’ function getLeaderByYear($year) { // get leader from mysql } // other functions } http://codeigniter.com/user_guide/general/models.html
CMS Content Management Systems
CMS Readymade Scripts in PHP/SQL East to install and run,
free! Blogs, Wikis, Forums, Store, etc... Blog: Wordpress, Typepad General: Drupal, Joomla Others, MediaWiki, Zen Cart
OpenSourceCMS.com
Analytics Keeping Track of Users
One Stop Shop
Analytics Daily Visits Bounce Rate (Who Stays) Location Search Engine
Terms Really really stalkerish! 0 25 50 75 100 2007 2008 2009 2010
Add some JS Code to all pages http://www.youtube.com/watch?v=HGK7LJGfC2w
SEO Search Engine Optimization
Some Basics Before we get into the interesting stuff
<title>
None
<meta name=”description”> Facebook is a ... </meta>
None
Have Keywords | Two Audiences | Be Specific Title URL
Description www.google.com/trends
Sitelinks Google Decides | Simple URL Structure | Descriptive Anchors
Use the Right Tags <h1> <h2> | Use <h1> for
main heading, <h2> under, ... CSS Makes them redundant, but search engines care
Anchor Text Name of link to site matters! <a href=”me.com”>awesome</a>
<a href=”me.com”>terrible</a> Becomes keyword for me.com Wikipedia linked as reference, thus does well on Google!
Image Alt Text Never Leave Empty Be Descriptive “Google” vs.
“Google Postini” Helps with image search
URLs ... can get really tricky!
URLs Matter Heavily Keywords Come from URLs Have Relevant URL
Names Not too long Separators / - _ Wikipedia URLs are Great!
Canonical URLs www.google.com/voice www.google.com/voice/ www.me.com me.com ... are different! Decide
one, redirect! ... or they’ll compete, both lose! Use HTTP 301
None
http://blog.mywebsite.com vs. http://mywebsite.com/blog
Subdomains? Rank shared with directories Before: Subdomains another website Today:
Not the same as subdir, but closer Kinda “Share” Rank with rest of site Pros and Cons http://www.mattcutts.com/blog/subdomains-and-subdirectories/
None
None
None
PageRank Ranks pages on the web Uses links as votes
More incoming links =) Google’s Bread and Butter Matrix Algebra, Graph Theory
PageRank Simplified A B C D Nodes = Websites |
Edges = Links
The Web A B C D Initially, set PR(A) =
PR(B) = PR(C) = PR(D) = 1/4 | PR = PageRank
The Web A B C D Pagerank ~ # In
Links PR(A) = PR(C) + PR(D) = 0.25 + 0.25 = 0.50 Similarly PR(B) = 0.50 PR(C) = 0.25 PR(D) = 0.25
Dilution If I vote for everyone, my vote isn’t important!
The Web A B C D Divide by # Outgoing
PR(A) = PR(C)/2 + PR(D)/1 = 0.125 + 0.25 = 0.375 Similarly PR(B) = 0.25 PR(C) = 0.125 PR(D) = 0.25
Iterate Repeat Using new Pageranks, until changes are little
A B C D
No Follow <a href=”site.com” rel=”nofollow”>Site</a> Might link to potentially bad
site Refuse to give it your Pagerank Useful for sites like Digg.com If you’re Dugg, PR stays the same
Remember This is ranking for a keyword Iterates to convergence
PR ~ # In Links & In Quality Quality ~ 1/Out Links Keywords matter, a lot!
Google Bombs ... circa 2006
Large-Scale Distributed Efforts
But not always evil...
Link Farms Lets Analyze These
Link Farms ~ Cliques
Web Grows Quicker than Cliques
Cliques Become Less Relevant | Dilution in PageRank
Link Doping Blogrolls | More Efficient | Less Dilution
Week 8 Week 9
Homework Dead easy, awesome! Can pass with just this HW
“andrewID is a zeliveau” Points = Pagerank Pagerank = [0, 10] Compete! See “rankmaniac” Zeliveau
Photo Credits http://www.interactivecleveland.com/blog/uploaded_images/pagerank10-743814.gif http://www.scienceoftheweb.org/15-396/lectures/PageRank_Lecture12.pdf http://www.amitbhawani.com/blog/Images/W/Web-Hosting-Server-Room.jpg http://www.iconarchive.com/icons/awicons/vista-artistic/256/2-Hot-Home-icon.png http://www.rice.edu/vpit/innovation/presspix/rice_data_center06052007x300.jpg http://www.scienceoftheweb.org/15-396/lectures/PageRank_Lecture12.pdf http://xkcd.com/208/ http://www.riesbeckfoods.com/images/2BakeryCollage.jpg
http://hookedonhouses.net/wp-content/uploads/2009/06/shop-around-the-corner-ext.jpg http://ceoworld.biz/ceo/wp-content/uploads/2009/10/barnes_and_noble.jpg
None