120 likes | 505 Views
Web Communication Internet Client attempts to “pull” information from server http message sent across Internet by TCP/IP* packet switching used to route message across the Internet to the proper destination From there, message routed to web server via local area network routers
E N D
Web Communication Internet • Client attempts to “pull” information from server • http message sent across Internet by TCP/IP* • packet switching used to route message across the Internet to the proper destination • From there, message routed to web server via local area network routers • Web server handles request (which usually entails looking up a file and send it back across the Internet) • * - TCP/IP accrues a time-costly penalty when packets are dropped/lost, a more efficient protocol is UDP which permits streaming packets – this is not necessary if we are transmitting a small number of packets LAN Switch Router LAN Switch Web Server Client Internet is the performance bottleneck
Internet Communication • Communication over the Internet needs 3 parts • 1. Connections between machines – physical connection by means of cable (coaxial, fiber optic, telephone lines), microwave, satellite, cellular, etc • 2. Routers – devices that take a message, examine the destination address and route the message on the next leg • 3. DNS – domain name servers are basically look up tables that translate from IP aliases to IP addresses • DNS tables are located in many places on the Internet such that, if your local DNS is incomplete, your DNS server contacts another DNS to obtain the information that wasn’t available locally
Proxy Servers • In order to reduce the amount of Internet traffic and the time needed for an http request to be fulfilled, proxy servers can be added to your network • They reside on the client side of the Internet • Requests are first sent to the proxy server • The proxy server may be able to fulfill the request more conveniently • by accessing cached data • by finding a better server to communicate with • by reducing the need for security measures (e.g., if you are already logged in to secure server) • They can also provide an added degree of anonymity • And add a layer of protection by scanning for malware before being delivered to the client • We will explore proxy servers in chapter 11 and examine the popular Squid proxy server
Internet Proxy Servers Added Region 1 Proxy Server Region 2 Proxy Server Web Server Static content (html, jpeg) and dynamic content(php, ruby) Database Region 3 Proxy Server
Virtual Hosts • Imagine that a company has a single web server but wishes to have different IP aliases to denote different departments: • cs.nku.edu versus math.nku.edu versus music.nku.edu • This can be accomplished through virtual hosts (also known as virtual servers or shared servers) • The idea is that each domain name is mapped to the same server but to different directories on that server • So cs.nku.edu would be found under DocumentRoot/cs while math.nku.edu would be found under DocumentRoot/math • This allows each department to have their own directory with its own permissions but also allows them to be mapped to their own unique name • This concept can be extended to different organizations sharing the same physical server • www.company1.com and www.company2.com share the same server but appear to map to entirely different domains • We examine virtual hosts in chapter 6
Security • TCP/IP is an encryption-less protocol • That is, it does not directly support the ability to encrypt a message • Without proper encryption, messages sent over the Internet are insecure – anyone with the know-how can intercept such a message • if the messages are encrypted, while still insecure, the interceptor cannot actually read or make sense of the message • Additionally, the Internet requires the ability to submit information to and retrieve information from a database • We need proper mechanisms to make sure that the client is authorized • So we need two forms of security • Authorization (which itself can be broken into two categories: verifying one’s identity and ensuring proper permissions) through some login mechanism • Encryption • We study security in chapters 9 and 10
Apache • A web server – the most popular of all web servers, and one of the most popular open-source projects • Software which allows a computer to respond to http requests and respond with files • although the most recent version is 2.2, the textbook concentrates on 2.0, we will experiment with 2.2 in the lab • Apache comes with a number of modules, most of which are loaded by default • in earlier versions of Apache, you would have to explicitly load modules, now most are part of Apache’s core • In chapter 5, we will explore many of the modules and we will look at others in other chapters • in addition to modules that perform tasks like security, spell correction, etc, we will look at some of the language modules to support server side scripting • the more modules you add on, the more time it takes for Apache to process requests – by being familiar with the modules, you can determine which one(s) you might need for any given situation
Modules • Although we will cover the modules in chapter 5, here is a bit of a sneak peak at what is available • Authentication modules • using a textfile of usernames/passwords, or database files stored using the Berkeley DB, DBM, MD5, LDAP database, SQL DB, or others • CGI modules • permit the use of CGI script execution • Logging and status modules • while Apache maintains its own log of accesses and errors, you can control what is logged and where by loading additional modules • Cache and proxy modules • Security modules • limit access by lists of client names, or provide SSL encryption in communication • WebDav and miscellaneous modules
Web Programming • There are two sides to web programming • Client side • code that runs in the client browser, usually javascript but possibly java applets, php, perl or other • Server side • code that runs on the server to either generate pages (dynamic html) or to perform some operation on the server side (e.g., access a database) • this code is typically written in asp, php, perl or python but its also possible that it might be written in javascript • While you have already studied both sides in 286 and 301 • We will use a little of your server side programming knowledge in class to see how to load and configure modules to handle server side scripts
Web Databases • MySQL is one of the more popular databases to support the web • While it is open source, you can also purchase a library if you do not with to abide by the open source GPL • Another open source DB is Firebird, based on BorelandInterBase 6.0 • PostgreSQL is another open source DB which has many advanced features that you might find in a commercial DB • Non open-source DBs include Oracle, IBM’s DB2, MS SQL Server • While we will not implement a DB as part of this course, you will explore this in other CIT courses, predominantly 486 • The web database will run as a daemon in Linux • The web server program must establish a connection with the daemon at run-time, which can be time consuming and thus slow down your server
Static vs Dynamic Web • The web was originally developed as a static entity • Web pages were static, the client loads new pages on demand from the user • This creates a “stateless” machine – the only state is indicated by the web page • We need a dynamic web • Storing more of a state • User log ins, shopping carts, personalized content • To accommodate this, we add • Cookies – locally stored data such as log in information or shopping cart • DHTML – pages that are generated dynamically at the server based on content acquired from a database, using server side scripting to put together the page