Apache Web Server Setup 1

1,477 views

Published on

http://www.cju.com/classes/2002/WMB-520/

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,477
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
46
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Apache Web Server Setup 1

  1. 1. WMB-520: Web Technology Web Server Setup Rutgers University Center for Applied Computing Technology Instructor: Christopher Uriarte Meeting 1: Introduction to the Internet, World Wide Web and Web Servers
  2. 2. Course Overview and Goals <ul><li>This course will teach you how to install, configure, and administer a Web server that runs on a Unix system and can be used to deliver dynamic content. </li></ul><ul><li>The course objectives will be achieved through a combination of lectures, demonstrations, and hands-on exercises. </li></ul>
  3. 3. About Your Instructor… <ul><li>Chris Uriarte – chrisjur@cju.com. Feel free to contact me anytime via email. </li></ul><ul><li>Homepage for this class linked from: </li></ul><ul><ul><li>http://www.cju.com/classes </li></ul></ul><ul><ul><li>Contains all slides, notes and misc. links and resources. </li></ul></ul>
  4. 4. What This Course Is and Is Not <ul><li>The purpose of the course is to teach you the concepts behind serving content on the web and how to run and administer web server software on a UNIX system. This means you will be learning how to use tools to deliver content for the World Wide Web, not to create content. </li></ul><ul><li>Rutgers offers other courses designed to teach you how to create content for the World Wide Web (HTML design, Perl, etc.) </li></ul>
  5. 5. Prerequisites <ul><li>Familiarity with a Web browser such as Netscape or Internet Explorer. </li></ul><ul><li>You MUST have user-level experience with UNIX and must be familiar with the use of a UNIX text editor like vi, emacs and pico </li></ul>
  6. 6. Class Schedule <ul><li>Week 1 : Introduction to the Internet, the World Wide Web, and Web Servers </li></ul><ul><li>Week 2 : Installing and Configuring the Apache Web Server </li></ul><ul><li>Week 3: Extending Apache: Advanced Topics </li></ul><ul><li>Week 4: More advanced configuration and Web Security </li></ul><ul><li>Note: classes 2-4 are hands-on classes. </li></ul>
  7. 7. Course Resources <ul><li>Textbook: Apache: The Definitive Guide by Laurie, Laurie and Denn (O’Reilly Press, 1999). </li></ul><ul><li>User account on UNIX server blender.rutgers.edu . (Remote access available via SSH) </li></ul><ul><li>Slides and resources on class hompage, linked from http://www.cju.com/classes/ </li></ul>
  8. 8. How does the World Wide Web Work? <ul><li>Works on a client/server model: The Web server software is the server component, the Web browser is the client component. Purpose of the Web server is to provide documents to clients. </li></ul><ul><li>Web servers, Web browsers, and the information that is shared between them through the Hypertext Transfer Protocol (HTTP) protocol make up the World Wide Web. </li></ul>
  9. 9. History of the World Wide Web <ul><li>Grew out of the Internet, a network of networks that began in the early 1970’s and was used to support a variety of services (including telnet, ftp, Usenet, email, and gopher). Most of these services communicated via via TCP/IP (Transmission Control Protocol/Internet Protocol). </li></ul><ul><li>In 1989, Tim Berners-Lee at CERN developed a new system to simplify document distribution and to allow documents to be linked together. Called the “World Wide Web.” </li></ul>
  10. 10. Web History, con’t. <ul><li>In 1993, the National Center for Supercomputing Applications (NSCA) released to the public the NCSA Web Server software and a GUI Web browser, called Mosaic. Quickly became popular. </li></ul><ul><li>Mosaic became Netscape – first major web browser distribution. </li></ul>
  11. 11. The Web Today <ul><li>The Web has evolved greatly since it was first implemented, but it’s overall architecture has remained generally the same. </li></ul><ul><li>Still fueled by three major components: A network (typically the Internet, but can also include local networks or Intranets), a client component (a web browser) and a server software component (what we’re going to learn about in this class). </li></ul>
  12. 12. Webmasters, Sys-Admins and Developers, Oh My! <ul><li>There are a number of key roles that are necessary to support a web infrastructure. Providing end-to-end web services requires knowledge about systems, network, software, graphical design, programming and much more. </li></ul><ul><li>There are many different </li></ul>
  13. 13. Roles in the Web World: <ul><li>Web Designers – Create graphical elements and determine layout of Website. </li></ul><ul><li>Content Providers- Create and edit HTML documents. </li></ul><ul><li>Web Developers – Write web applications using programming languages such as Java, JavaScript, ASP, PHP and Perl other used to deliver dynamic content. </li></ul>
  14. 14. Roles in the Web World (con’t): <ul><li>System Administrators – Responsible for maintaining the Web server software and often the operating system and hardware where the Web server is installed. </li></ul><ul><li>Network Administrators – Responsible for the design and maintanance of network components used to deliver web content. </li></ul><ul><li>For most organizations, these responsibilities tend to be split over multiple job positions except for very small and simple Web sites. </li></ul>
  15. 15. Hosting A Website: The Planning Phase <ul><li>There are a number of key questions an organization or individual must ask when planning to deploy a website: </li></ul><ul><ul><li>How and where will you host it? </li></ul></ul><ul><ul><li>What kind of hardware will you use? </li></ul></ul><ul><ul><li>What kind of Operating System will the hardware run? </li></ul></ul><ul><ul><li>What Web server software will you use? </li></ul></ul><ul><ul><li>What domain name will your site use? </li></ul></ul><ul><li>Answers to above questions usually determined by budget, staffing, and existing infrastructure of your organization. </li></ul>
  16. 16. Hosting Your Website: Options <ul><li>Use a Free Page Site – For personal use, limited space and tools, typically adds advertisements. (examples: Yahoo, Tripod, Xoom, etc.). Limitation on amount of traffic your site is allowed. Generally not an option for business use. </li></ul><ul><li>Personal Page Site – For personal use, usually included with an ISP (about $20 per month), includes small amoung of disk space, no or limited access to server-side technologies for delivering dynamic content, generally uses your ISP’s Internet domain name. Limitation on amount of traffic your site is allowed. (Website URL usually looks something like: http://www.yourisp.com/~yourusername ). Might be an option for very small businesses. </li></ul><ul><ul><li>Under both models, ISP owns and manages the server, network and web server software. You simply provide the content. </li></ul></ul>
  17. 17. Hosting Your Website, con’t. <ul><li>Virtual Hosting – Most popular web hosting option todays. Suitable for business or personal use. Using this model, an ISP uses one machine to host many different websites (sometimes called “shared hosting”). You can use your own Internet domain name ( http://www.yourdomain.com ). These typically provide a wide range of tools for building more complex Websites. </li></ul><ul><ul><li>ISP owns and manages the server, network and web server software. You simply provide the content. </li></ul></ul><ul><ul><li>Overall cost based on disk usage and website traffic, ranges from $20 to several thousands of dollars a month. Now generally available through all ISPs and specialized Hosting-only providers such as Highway Technologies ( http://www.hway.net ) and YourDomainHost ( http:// www.yourdomainhost.com ) </li></ul></ul>
  18. 18. Hosting Your Website, con’t. <ul><li>Dedicated Server Services – For business use, ISP owns and the hardware and network. Your organization typically has the option of managing and configuring the server. You provide the content. Your organization has exclusive access to the server. </li></ul><ul><ul><li>Price based on the type of server you require and the amount of traffic your site uses. </li></ul></ul><ul><li>Co-Location Services (“co-lo”) – For business use - Your organization owns and manages the hardware, software and content. ISP provides you with space to place the server and the network connectivity. </li></ul><ul><ul><li>Price based on the amount of space your servers require, the power requirements of the servers and the amount of traffic. </li></ul></ul>
  19. 19. Hosting Your Website, con’t. <ul><li>Managing your Own Web Server Network (“in-house” web hosting) – You provision, configure and manage the network connection, hardware, software and provide the content. </li></ul><ul><ul><li>Most flexible option – you have complete control. </li></ul></ul><ul><ul><li>Cost can be very high or very low – depending on the business need. </li></ul></ul>
  20. 20. Hosting Your Web Server: Do It Yourself Networking Options <ul><li>For an Intranet Server– Need a LAN (local area network). Does not require an Internet connection. </li></ul><ul><li>For an Internet Server – Need a dedicated Internet connection. Internet Connectivity Options: </li></ul><ul><ul><li>POTS (up to 56Kbps) – not practical for web use anymore. </li></ul></ul><ul><ul><li>ISDN (128Kbps) – not practical for web use either (costly, slow) </li></ul></ul><ul><ul><li>Cable (512Kbps – 10Mbps) </li></ul></ul><ul><ul><li>DSL (128kps – 1.54 Mbps+) </li></ul></ul><ul><ul><li>T-1 (up to 1.54Mbps) – full, fractional, or burstable </li></ul></ul><ul><ul><li>T-3 (up to 45 Mbps) – full, fractional, or burstable </li></ul></ul>
  21. 21. Finding an ISP <ul><li>Some ISPs specialize in web hosting and provide all the service described earlier (shared hosting, dedicated server, co-location, etc.). </li></ul><ul><li>Other ISPs specialize only in commercial Internet access (AOL, Earthlink, etc.). They may provide free personal website space. </li></ul><ul><li>Check The List – http://thelist.com , for a comprehensive list ISPs and their services. </li></ul>
  22. 22. Hosting Your Server: Hardware Options <ul><li>There are a number of things to consider when choosing the hardware platform for your website: </li></ul><ul><ul><li>Need to select a machine architecture (i.e Intel Compatible PC, Sun, Macintosh) – Typically dictated by your Operating System of choice </li></ul></ul><ul><ul><li>Processor speed and number of processors. </li></ul></ul><ul><ul><li>RAM and Disk Space. </li></ul></ul><ul><ul><li>NIC card. </li></ul></ul><ul><li>Price can range from several hundred dollars to thousands of dollars. </li></ul>
  23. 23. Web Server Hardware Myths vs. Realities Myth Reality
  24. 24. Important Notes about Web Server Hardware <ul><li>Web Servers need fast disk access and a lot of RAM to handle high-volumes of traffic. </li></ul><ul><ul><li>Not unusual to see web servers with 1GB of RAM and 10,000RPM hard drives. </li></ul></ul><ul><li>Processor speed and performance becomes very important when delivering dynamic content via custom web application. </li></ul><ul><li>High-end PCs can typically handle 100K+ website visits per day. </li></ul>
  25. 25. Hosting Your Server: Operating System Options <ul><li>Commercial Versions of Unix (i.e. Solaris HP-UX, AIX, MacOS X, IRIX). </li></ul><ul><li>Free Versions of Unix (i.e. Linux, FreeBSD). </li></ul><ul><li>Microsoft Windows (9x, NT, XP, Windows 2000). </li></ul><ul><li>Windows vs. Unix – raises issues of easy of use, stability, scalability, open source, and pricing. UNIX platforms generally considered more reliable, scaleable and cost-effective. </li></ul>
  26. 26. Hosting Your Server: Web Server Software Options <ul><li>The primary focus of this class will be installing and configuration the web server software – the software the turns an ordinary computer into a computer that can host and serve content on the World Wide Web. </li></ul><ul><li>Web server software is often referred to as: </li></ul><ul><ul><li>The Web server </li></ul></ul><ul><ul><li>The web daemon </li></ul></ul><ul><ul><li>The “httpd” </li></ul></ul>
  27. 27. Hosting Your Server: Web Server Software Options <ul><li>According to the Oct. 2002 Netcraft Web Server Survey ( http:// www.netcraft.com ), four Web server software distributions support over 90% of all Websites on the Internet: </li></ul><ul><ul><li>Apache - 65% </li></ul></ul><ul><ul><li>Microsoft Internet Information Server - 25% </li></ul></ul><ul><ul><li>Zeus Web Server - 1.4% </li></ul></ul><ul><ul><li>iPlanet – 1.3% </li></ul></ul>
  28. 28. Web Server Software Options: Apache <ul><li>“ The standard” for UNIX web servers.. </li></ul><ul><li>The most popular web server. Considered to be the most secure, stable and robust server platform. </li></ul><ul><li>Originally based on NCSA httpd code. </li></ul><ul><li>Can be installed under most Unix variants and Windows. Binary versions available for many operating systems. </li></ul><ul><li>Uses file-based configuration, although some GUI tools are also available. </li></ul>
  29. 29. Introduction to Apache, con’t. <ul><li>Unix versions very stable. Windows version less mature, but becoming more stable. Apache 2.0 is released. </li></ul><ul><li>Very Fast and uses resources efficiently. </li></ul><ul><li>Freely distributed source code. Can be modified for commercial or non-commercial use. </li></ul><ul><li>Price: Free. Developed by the Apache software foundation. </li></ul><ul><li>See http://www.apache.org for more information. </li></ul>
  30. 30. Web Server Software Options: SunOne/iPlanet/Netscape Server <ul><li>Now officially called the SunOne Web Server </li></ul><ul><li>Originally developed as Netscape Server, then distributed by partnership between Sun/Netscape, now owned and supported by Sun. </li></ul><ul><li>Server packages: iPlanet/Netscape Enterprise Server, Netscape Fast-Track Server. </li></ul><ul><li>Runs under Windows NT, Solaris, HP-UX, Digital Unix, AIX, Linux. </li></ul>
  31. 31. Netscape/SunOne Server, con’t. <ul><li>Uses Web-based administration. </li></ul><ul><li>Can be resource intensive. </li></ul><ul><li>Lost major portion of market over last 5 years. </li></ul><ul><li>Price: $1495 per CPU </li></ul><ul><li>http://wwws.sun.com/software/products/web_srvr/home_web_srvr.html for more information. </li></ul>
  32. 32. Web Server Software Options: Microsoft Internet Information Server (IIS) <ul><li>Most popular for Win NT and 2000-based web servers. </li></ul><ul><li>Version 4 runs on Windows NT Server. IIS version 5 runs on Windows 2000 Server (and XP, but used for development purposes only). </li></ul><ul><li>GUI-based administration. Web-based administration available as well. </li></ul><ul><li>May not scale well. </li></ul>
  33. 33. Microsoft IIS, con’t. <ul><li>Increasing concerns over its security. </li></ul><ul><li>Source code not available. Extendable through Microsoft’s Internet Server API (ISAPI). </li></ul><ul><li>Price: Free with NT Server 4.0 and Windows 2000 Server </li></ul><ul><li>See http://www.microsoft.com/windows2000/technologies/web/default.asp for more information. </li></ul>
  34. 34. How the Internet Works: Networking Basics <ul><li>For a Web server to be useful needs to be attached to a network. </li></ul><ul><li>Minimum requirements for a computer network – at least two computers that have a media and a method of communicating. </li></ul><ul><li>All Internet applications use TCP/IP (Transmission Control Protocol/Internet Protocol) for low-level communications. </li></ul>
  35. 35. Networking Basics: TCP/IP <ul><li>TCP/IP is actually a combination of 2 protocols: </li></ul><ul><li>A transport layer protocol called the Transmission Control Protocol (TCP) </li></ul><ul><li>A network protocol called the Internet Protocol (IP) </li></ul>
  36. 36. Networking Basics: IP Addresses <ul><li>TCP/IP uses IP address to identify different devices. Every computer on the Internet must have a least one unique IP address. </li></ul><ul><li>IPv4: IP address are four 8-bit numbers separated by dots: 165.230.30.68 </li></ul><ul><ul><li>Usually divided in three parts: </li></ul></ul><ul><ul><li>165.230 is one of Rutgers’ networks – e.g. no one else has addresses starting with 165.230 </li></ul></ul><ul><ul><li>30 is the subnet portion of the address </li></ul></ul><ul><ul><li>68 is the particular node, or host portion of the address </li></ul></ul><ul><li>Division not necessarily on octet boundary. </li></ul>
  37. 37. TCP/IP: Two Friends, Working Together <ul><li>IP - An IP address represents a machine’s identity on the internet and tells other machines how to get to it – similar to your street address (e.g. 123 Main Street, Anytown, USA). </li></ul><ul><li>TCP is a mechanism used to ensure that anything sent to a specific IP address makes it there in one piece. – similar to the Post Office. </li></ul><ul><li>Together, TCP/IP assures that anything sent to a server on the Internet is delivered to the right place in one complete piece. </li></ul>
  38. 38. Networking Basics: IP Addresses <ul><li>IP addresses no longer being distributed by classes – blocks are distributed to ISPs on an as-needed basis and must be justified. </li></ul><ul><li>IP addresses are hard to come by. How do you get them? </li></ul><ul><ul><li>Your ISP received an “address space” from the ARIN (http://www.arin.org) </li></ul></ul><ul><ul><li>You receive IP addresses from your ISP. </li></ul></ul>
  39. 39. Networking Basics: Tools <ul><li>Network interfaces need to be assigned IP addresses. </li></ul><ul><li>Interfaces can be configured using ifconfig command on UNIX machines. </li></ul><ul><li>Type ifconfig –a to view current configuration settings. </li></ul><ul><li>Additional tools for network monitoring: ping, traceroute, tcpdump, netstat, arp, snoop . </li></ul>
  40. 40. Networking Basics: DNS <ul><li>IP addresses are usually paired with more human-friendly names The system that contains the IP Address-to-Hostname pairing is called the Domain Name System (DNS). </li></ul>internet.rutgers.edu Hostname Organization Top-level domain <ul><li>Other top-level domains include .com, .gov, .org, etc. There are also country-specific domains like .uk, .ca, .jp, etc. </li></ul>
  41. 41. Networking Basics: DNS, con’t. <ul><li>Domain name information is maintained through a distributed database of host name/ IP address pairing. </li></ul><ul><li>The Network Information Center (NIC) manages the top-level domains and maintains a database of registered name servers for all domain names. </li></ul><ul><li>Host name assignments maintained through zone files on primary and secondary DNS servers controlled by the organization that owns the domain (or their ISP). </li></ul>
  42. 42. Networking Basics: DNS, con’t. <ul><li>Network Solutions (previously the InterNic) registers domain names – See http://www.networksolutions.com . Other registrars include Register.com </li></ul><ul><li>Costs range from $20 to $50 per year. </li></ul><ul><li>ISP’s often offer domain name registration as part of other packages (such as web hosting packages). </li></ul><ul><li>Need to register a primary and secondary domain name servers for your domain and arrange to have zone files created on DNS servers. Your ISP will typically configure this for you. </li></ul>
  43. 43. DNS Overview: If Computers on the Internet Could Talk…
  44. 44. Networking Basics: DNS Tools <ul><li>There are several tools for for monitoring DNS information: </li></ul><ul><ul><li>whois – tells you the owner and primary DNS servers associated with a domain (e.g. whois yahoo.com ). Also available via web browser at www.networksolutions.com . </li></ul></ul><ul><ul><li>nslookup and host – tell you IP address information for a particular hostname on the internet (e.g. nslookup www.yahoo.com or host www.rutgers.edu ) </li></ul></ul>
  45. 45. DNS Exercise <ul><li>What are IP addresses of the DNS servers that contain information about rutgers.edu? </li></ul><ul><li>What are the IP address of: </li></ul><ul><ul><li>www.retaildecisions.com </li></ul></ul><ul><ul><li>abusaday.admin.cju.com </li></ul></ul><ul><ul><li>www.linux.org </li></ul></ul>
  46. 46. Networking Basics: Ports <ul><li>Servers tend to run a number of services. A single NIC can be used to provide multiple services through ports . </li></ul><ul><li>Network server software “listens” on specific ports. Clients contact server by specifying an IP address and a connection port. The port is the “identifier” that tells a server what application a piece of network traffic is destined for. </li></ul><ul><li>Common services and port numbers: </li></ul><ul><ul><li>smtp 25, ftp 21, telnet 23, http/web 80, https/ssl 443 </li></ul></ul><ul><ul><li>A list of services and ports is contained in the /etc/services file on UNIX systems. </li></ul></ul><ul><li>Ports below 1024 are reserved for special system services and can only be used by programs started by root (the system administrator on a UNIX system). </li></ul>
  47. 47. Uniform Resource Locator (URL) <ul><li>URL: a fancy way of saying “web site address” </li></ul><ul><li>Anatomy of a URL: </li></ul>http://internet.rutgers.edu:80/ITI520/index.html Protocol Hostname Port Number Path To File
  48. 48. Unix Tools and Commands <ul><li>File Editors: vi, emacs, pico </li></ul><ul><li>File system navigation: cd </li></ul><ul><li>File management: mv, rm, mkdir,rmdir, ls, chmod, ln </li></ul><ul><li>Archiving and compression: tar, gzip </li></ul><ul><li>***Process management: ps, kill </li></ul><ul><li>Man pages available for all these commands, e.g “man rmdir” </li></ul>
  49. 49. UNIX Process Management <ul><li>UNIX Processes are managed using the ps and kill commands </li></ul><ul><ul><li>ps is used to list processes running on the system </li></ul></ul><ul><ul><li>kill is used to kill and restart processes running on the system </li></ul></ul><ul><li>Every time you start a new program (pico, vi, bash, etc.) a process is created and you are the owner of that process. </li></ul><ul><li>Each process is assigned a unique Process ID (PID) on the system </li></ul>
  50. 50. Process Management Exercises <ul><li>You can type ps –aux to see all the processes running on a system. This will list the process owner, process ID (PID) and the command being run. </li></ul><ul><li>You can kill any PID, as long as you are the owner of the process. </li></ul><ul><li>ps –aux | grep username will show all the processes your are currently running </li></ul>
  51. 51. Process Management Exercises, con’t. <ul><li>Open up a new UNIX terminal window and type vi foo.txt . This will create a new process on the system that you own. </li></ul><ul><li>Open a second terminal window on the same UNIX system. Locate the process ID for your vi session and kill it. What happens? </li></ul>
  52. 52. Reading for Next Week… <ul><li>As assigned in class… </li></ul>

×