140x Filetype PDF File size 0.36 MB Source: yslaiseblog.files.wordpress.com
LAB 1 HOW THE WEB WORKS What You Will Learn About IP addresses and Domain Names About some web browser plugins to help with development Examine headers sent by the HTTP protocol How to trace the route that your packets take Approximate Time The walkthroughs in this lab should take approximately 30 minutes to complete. Fundamentals of Web Development with PHP Randy Connolly and Ricardo Hoar Textbook by Pearson http://www.funwebdev.com 2 Lab 1 HOW THE WEB WORKS Exercise 1.1 — YOUR IP ADDRESS 1 Depending on what OS you are using, there are different tools you must use to get your IP address. We will use the most fundamental techniques possible, which are least affected by OS upgrades and user interfaces. I N WINDOWS Open up the command window by either clicking a shortcut, or typing cmd in the run window. ON MAC OR LINUX Open up a terminal window, by going into applications and choosing a terminal. Either way a small text window should appear that will take your commands. It may show your computer name or current location depending on the version and configuration. This command window is an essential tools for the web developer. Become familiar with it. 2 In the newly opened command window you will type a simple command and get back information about your IP address. Because most computers have multiple adapters you will get IP information for each installed and configured device. This could be a wired connection, and a wireless connection. Since only 1 is being used at a time, we will look for the information about that at adapter. This output may seem daunting at first, but provides you with esstenial information. I N WINDOWS Into the cmd window type ipconfig The output will include output showing your IP address similar to: Wireless LAN adapter Wireless Network Connection: Connection‐specific DNS Suffix . : Link‐local IPv6 Address . . . . . : fe80::fc13:750:ffdd:1337%14 IPv4 Address. . . . . . . . . . . : 192.168.0.11 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 Fundamentals of Web Development 3 WEB DEVELOPMENT ON MAC OR LINUX Into the terminal type: /sbin/ifconfig The output will include output similar to the following. en1: flags=8863mtu 1500 ether c8:bc:c8:c2:74:91 inet6 fe80::cabc:c8ff:fec2:7491%en1 prefixlen 64 scopeid 0x5 inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255 media: autoselect status: active 3 Now you very likley have an internal IP address, unless you connected directly to the internet. IP addresses in the ranges are internal. 10.0.0.0 ‐ 10.255.255.255 172.16.0.0 ‐ 172.31.255.255 192.168.0.0 - 192.168.255.255 If so, we will have to determine what IP address wea re sharing, since that is the IP we will be known as outside our internal network. The easiest technique is to go to a web server on the internet that is designed to echo your IP address. Surf to http://examples.funwebdev.com/ipaddress.php and you will see your external IP address. It's important to remember that every time you visit a web page you transmit this external IP address in order to respond to your request with data. Similarly, every visitor to your site sends you their IP. Copyright © Randy Connolly and Ricardo Hoar 4 Lab 1 Exercise 1.2 — ANALYZING COMPONENTS OF A WEB PAGE 1 To do this next walkthorugh you must have firebug installed in your firefox web browser. To check, or install firebug 1. Go to tools‐> add‐ons in the firefox menu 2. Click on the Extensions tab and see if if firebug is listed. If not 3. Type firebug into the search window 4. Click install next to firebug and restart your browser 2 With firebug installed we can now do some powerful analysis of web page load times as described in Chapter 1. The first time you use firebug you will have to enable it. Surf to the webpage from Exercise 1 (to http://examples.funwebdev.com/ipaddress.php) and enable firebug by clicking on the firebug icon. 3 You will now see the firebug tool opoened below the web page. The tool has many tabs as shown below. Select the Net tab, and you may have to click Enable, and then reload 4 With the Net tab selected, you will now see all the requests that this web page makes to load itself completely. Trneds can be seen such as how many seperate domains resources are requested from, which resources take the most time, and the total load time.
no reviews yet
Please Login to review.