chapter 22 web hosting and internet servers xuanxuan su
TRANSCRIPT
Chapter 22
Web Hosting and Internet Servers
Xuanxuan Su
Topics Web
FTP
News
Web Hosting Web hosting platform
Reliability Maintainability Security Performance
Unix vs. Windows
HTTP protocol The foundation of the WWW TCP-based protocol Transmit documents
Text Pictures/Animation Audio/Video
Client(web browsers) initiated Platform independence
Web Server Answer HTTP requests
Listens on TCP port 80 Support Services
Secure HTTP Secure Socket Layer protocol Listens on TCP port 443
FTP
URL Protocol or application Hostname TCP/IP port Directory Filename
URL Examples
https://my.umbc.edu/fcgi-bin/myumbc.fcgi
http://sunserver1.cs.umbc.edu:8080/
telnet://spot.acme.com
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
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
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
Running Apache Httpd daemon
Start by hand Start from rc scripts
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
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
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
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)
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
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.