Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How the Web Works: Lecture 7

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

More Decks by Abhinav Sharma

Other Decks in Education

Transcript

  1. Homeworks Bad News =( The Project Idea Failed Minis are

    now Homeworks Still cover everything Just no project experience However...
  2. 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
  3. 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
  4. Domain Squatting Money for early movers! Registering trademarks is illegal

    Parking Pages Aftermarkets (TDNAM.com) But in my experience...
  5. More Recently... Google knows to ignore them Smarter parked websites

    Content Management Systems Social Networking Site Forum, Wiki, etc..
  6. Self Managed Managed Complete Control Comes with PHP/SQL/... “Lower” Costs

    Monthly Cost Upgrade, Backup Auto Upgrade/Backup Enterprises You and Me
  7. 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...
  8. 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
  9. SSH Secure Shell Control Server from Home Remember from C@CM?

    Awesome for Batch Tasks Learn about Shell Scripts
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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); // ... }
  15. class Race_Model { $year = 0 $leader = ‘’ $minion

    = ‘’ function getLeaderByYear($year) { // get leader from mysql } // other functions } http://codeigniter.com/user_guide/general/models.html
  16. 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
  17. Analytics Daily Visits Bounce Rate (Who Stays) Location Search Engine

    Terms Really really stalkerish! 0 25 50 75 100 2007 2008 2009 2010
  18. Have Keywords | Two Audiences | Be Specific Title URL

    Description www.google.com/trends
  19. Use the Right Tags <h1> <h2> | Use <h1> for

    main heading, <h2> under, ... CSS Makes them redundant, but search engines care
  20. 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!
  21. Image Alt Text Never Leave Empty Be Descriptive “Google” vs.

    “Google Postini” Helps with image search
  22. URLs Matter Heavily Keywords Come from URLs Have Relevant URL

    Names Not too long Separators / - _ Wikipedia URLs are Great!
  23. 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/
  24. PageRank Ranks pages on the web Uses links as votes

    More incoming links =) Google’s Bread and Butter Matrix Algebra, Graph Theory
  25. The Web A B C D Initially, set PR(A) =

    PR(B) = PR(C) = PR(D) = 1/4 | PR = PageRank
  26. 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
  27. 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
  28. 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
  29. Remember This is ranking for a keyword Iterates to convergence

    PR ~ # In Links & In Quality Quality ~ 1/Out Links Keywords matter, a lot!
  30. Homework Dead easy, awesome! Can pass with just this HW

    “andrewID is a zeliveau” Points = Pagerank Pagerank = [0, 10] Compete! See “rankmaniac” Zeliveau