HTTP

HTTP

  • What is this?
  • What is it for?
  • Web clients?
  • Web Servers?
  • Default port?
  • What layer of OSI model?

HTTP Transmission

  • Client makes request to server
    • http://host:port/path/to/document
      • What are the different parts above?
  • Server responds with requested file if it has it.

Virtual Hosts (Server)

  • Find matching host in list of enabled virtual hosts
  • if no match, serve default page
  • What document root do I look in?
  • Find requested file in the document root.
  • If file exists, return it, otherwise err.

Apache2 Installation Steps

  • apt-get install apache2
  • configure virtual hosts
  • create document root
  • add new names for sites to dns with CNAME records
  • enable site with a2ensite
  • restart apache

My HTTP example

Server: www.thegummibear.com/144.38.199.165

Virtual Host Document Root
squishy.thegummibear.com /var/www/html/squishy.thegummibear.com
iateat.thegummibear.com /var/www/html/iateat.thegummibear.com
www.thegummibear.com /var/www/html/www.thegummibear.com

HTTP Troubleshooting

  • Did you:
    • enable site
    • restart/reload apache
    • configure document root
    • check log files /var/log/apache2
    • check for typos
    • add your DNS records
    • dig