Lab 8 - Config a HTTP: Week 9 Virtual hosting: IP & Name based with Apache/httpd Session Outlines;  Virtual hosting with Apache/httpd o Multiple websites base on single IP address. o Multiple websites base on single NIC with multiple IP addresses Prerequisite: student needs to completed DNS/Bind exercise before process this lab work. Create Virtual hosts: www.sga.net.au and www.simt.edu.au web site base on the DNS/BIND lab. 1) Modify the httpd configurable file httpd.conf to support virtual name hosting capability. Open the Terminal, type nano /etc/httpd/conf/httpd.confand hit enter. Important Note: To achieve this task and minimal the troubleshooting later, student needs to checking, typing correctly the codes shown in the Figure 8-1 below. Step1: comment out (add the # sign in the front of each statement) the following statement in the httpd.conf as (1) in the Figure 7e-1. Figure 8-1 Step 2: add the codes as (2) in the Figure 8-1 at the end of the httpd.conffile. Note: the IP address must be replaced by your own web server IP address. When done, save and exit the nano editor. 2) Create webroot folder for www.sga.net.au and www.simt.edu.au domains. Figure 8-2 (1) to create webroot folder for www.sga.net.au domain to reflect the httpd.conf in the Figure 8-1. (2) to create webroot folder for www.simt.edu.au domain to reflect the httpd.conf in the Figure 8-1. (3) to create the index.html file for the sga.net.au domain, the content of the index.html can be anything simple. Note: To save time, the content of the index.html can simply “Welcome to …….any thing” and save the file. Don’t really need add the html opening and closing tags. (4) to create the index.html file for the simt.edu.au domain, the content can be any thing (5) to restart the httpd server. Note: The most important task. Not to forget restart your httpd server every time makes any change in the httpd.conf configure file. 3) Testing www.sga.net.au and www.simt.edu.au domains from the local web browser. Figure 8-3 Figure 8-4 The final result should display similar as Figure 8-3 and Figure 8-4. Now you have knowing how to create your own virtual hosts web server with Name-Base and configure the BIND/named server in Linux environment. Student own experiments 1: Making your web server with http over SSL or https with the following hints: How to create your own SSL (https) certificates in Linux using openssl: The following command to generate a private key that is file encrypted. You will be NOT REQUIRED password set o access the file when starting your webserver: opensslgenrsa -out domainname.key 1024 Type the following command to create a CSR with the RSA private key (output will be PEM format): opensslreq -new -key domainname.key -out domainname.csr to generate your own crt file openssl x509 -req -days 2000 -in domainname.csr -signkeydomainname.key -out dommainname.crt   Student own experiments 2: Implementing multiple IP-base hosting with the following hints: How to add a second IP address into Centos/Redhat on the same NIC login as root Change to /etc/sysconfig/network-scripts Copy the current network interface (ifcfg-eth0 for instance Linux has only one NIC) configuration file to become ifcfg-eth0:0 Edit ifcfg-eth0:0 file and change DEVICE to eth0:0 and make a new IP address and mask for this newly interface in IPADDR= field Restart the network service using /etc/init.d/network restart to activate the newly ip address. Or can use ifup eth0:0 to make this start eth0:0 interface Example outcome as below; Next, need to justify your DNS/BIND server and httpd.conf to suit to the new IP addresses setting. Lab2-1: HTTP HTTP is used to handle web pages. In this lab, we retrieve a web page and then, using Wireshark, capture HTTP packets. We learn about the two most common HTTP messages (GET and response). We also examine the role of browser caching. Assignment The assignment for this lab has three parts. Part I: General Start your web browser and clear the browser's cache memory, but do not access any website yet. Open Wireshark and start capturing. Go back to your web browser and retrieve any web page that contains embedded objects (pictures, logos, etc.). Since the browser's cache memory has been cleared, the web page is retrieved from the original destination. Type http (lowercase) in the filter field of the Wireshark and click Apply so that only HTTP messages are displayed. After enough packets have been captured, select the Capture from the pull-down menu and select Stop to stop capturing. The packet list pane of the Wireshark should now display many HTTP packets. Questions Using the captured information, answer the following question in your lab-report sheet 2 What is the source IP address of the first GET message? What is the destination IP address of the first GET message? What is the source IP address of the first response message? What is the destination IP address of the first response message? How the source and destination addresses in the first response message are related to those in the first GET message? Using the time stamps of a GET message and that of the corresponding response message, determine how long it took from the time the GET message was sent until the response message was received. By default, the value of the time column is the amount of time in seconds since Wireshark tracing began. From one of the messages, determine the HTTP version. From the first GET message, determine the URL of the website. From the first GET message, determine the user agent. Using the first GET message, determine the medium format, the language, the encoding, and the character set that the client can accept. What are the status codes for the first response message? Check the status code table to see the descriptions of this code. Record the etag(identity tag) of the first response message. What is the application of etagin conditional request in HTTP. What is the value of the content-length field of the first response message? Acknowledgement / References: 1. http://educypedia.karadimov.info/computer/javanetworking.htm 2. http://wps.aw.com/aw_kurose_network_4/63/16303/4173750.cw/-/4173752/index.html 3. http://www.visualland.net/ 4. http://www.net-seal.net/animations.php?sl=1 5. http://www.science.smith.edu/~jcardell/Courses/CSC249/HW/Wireshark_HTTP_SOLUTION_v6.1.pdf 6. http://www.eng.tau.ac.il/~netlab/resources/booklet/Wireshark_INTRO.pdf 7. http://www.arl.wustl.edu/~jst/cse/473/labs/studio1-supplement.pdf 8. http://bridges.brooklyn.cuny.edu/collegenow/modules/P7_Network_Security/Labs/Lab_1.pdf 9. http://people.uncw.edu/vetterr/classes/csc544-fall12/WireShark_Labs/Wireshark_Ethernet_ARP_Sept_15_2009.pdf 10. http://wiresharklabs.wordpress.com/2012/09/23/wireshark-lab-2-http/ 11. http://it.iut.ac.ir/sites/fsites/it/files/u4/uploads/Networking%20Class-Wireshar%20Labs-Solutions/09-Wireshark_NAT_Jan_8_2010_solutions.pdf 12. http://www.eng.tau.ac.il/~netlab/resources/booklet/Wireshark_TCP.pdf 13. http://www.cse.ust.hk/~muppala/csit5610/labs/Wireshark_labs/Wireshark_802_11.pdf 14. http://www.ittc.ku.edu/~jpgs/courses/nets/lecture-lab-wireshark-display.pdf 15. http://www.getbookee.org/wireshark-lab-5/