17
Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Embed Size (px)

Citation preview

Page 1: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Chapter 22

Web Hosting and Internet Servers

Xuanxuan Su

Page 2: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Topics Web

FTP

News

Page 3: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Web Hosting Web hosting platform

Reliability Maintainability Security Performance

Unix vs. Windows

Page 4: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

HTTP protocol The foundation of the WWW TCP-based protocol Transmit documents

Text Pictures/Animation Audio/Video

Client(web browsers) initiated Platform independence

Page 5: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Web Server Answer HTTP requests

Listens on TCP port 80 Support Services

Secure HTTP Secure Socket Layer protocol Listens on TCP port 443

FTP

Page 6: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

URL Protocol or application Hostname TCP/IP port Directory Filename

Page 7: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

URL Examples

https://my.umbc.edu/fcgi-bin/myumbc.fcgi

http://sunserver1.cs.umbc.edu:8080/

telnet://spot.acme.com

Page 8: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

CGI Scripting

What’s CGI? Common Gateway Interface Dynamically generate content Usually Perl/C programs

Security Concern CGI scripts have access to files, network

connections, and other methods of moving data

Anyone can run a program on HTTP server

Page 9: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

HTTP Server Installation Why Apache HTTP server?

A powerful, flexible, HTTP/1.1 compliant web server

Support OS: Unix, Linux, Windows NT/9x, Netware 5.x, OS/2, and etc.

Open source Highly configurable and extensible

with third-party modules

Page 10: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Configuring Apache Configuration files in the conf directory

httpd.conf TCP port Location of log files and document files Network and performance parameters Virtual hosts

srm.conf Controls server access resources DocumentRoot Definition

access.conf Controls access on a per-file or per-directory basis

Page 11: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Running Apache Httpd daemon

Start by hand Start from rc scripts

Page 12: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Virtual Interfaces Why virtual interfaces?

Host multiple websites on a single server Configuring

Create the virtual interface at the TCP/IP level

Interface:instance, for example, eth0:1 Use ifconfig command /etc/sysconfig/network-scripts make it permanent

Tell Apache about a virtual interface Add VirtualHosVirtualHost clauses in the http.conf file

Page 13: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Caching and Proxy Servers Why proxy?

Exponentially growing information on Internet Use replication on a national, regional or site

level Squid Internet Object Cache

http://www.squid-cache.org/ Support HTTP FTP, gopher, and SSL reduce access time as well as bandwidth

consumption

Page 14: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Setting up Squid Most important resource is physical

memory, RAM and disk space Compile

% tar xzf squid-2.0.RELEASE-src.tar.gz % cd squid-2.0.RELEASE % ./configure % make

Install % make install edit and customize the squid.conf file

Page 15: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Setting up Squid(cont) Start

create the swap directories% /usr/local/squid/bin/squid –z

Start Squid by command% /usr/local/squid/bin/squid (Squid 2.X)% /usr/local/squid/bin/RunCache (Squid

1.1.X)

Page 16: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Anonymous FTP Server Setup Why FTP?

Distributes software, document drafts and the like

Allows users to inspect the properties of files Anonymous FTP

FTP daemon: ftpd Managed by inetd

/etc/inetd.cof /etc/services

Installed and turned on by default in Red Hat

Page 17: Chapter 22 Web Hosting and Internet Servers Xuanxuan Su

Usernet News What’s usenet?

the set of machines that exchange articles tagged with one or more universally-recognized labels, called newsgroups

Delivery method: flood fill Usenet news feeds

Retain the services of a company that specializes in hosting Usenet

Get a “pull” feed from upstream service provider Receive a normal feed that includes the article

headers but not the bodies. The article is pulled only when a user asks to.