Download presentation
Presentation is loading. Please wait.
Published byBethanie Stokes Modified over 9 years ago
1
Web Server Administration Chapter 6 Configuring a Web Server
2
Overview Understand how a Web server works Install Apache Web servers Examine the Apache properties Host multiple Web sites Configure new Web sites in Apache Understand virtual directories
3
How a Web Server Works HTTP (Hypertext Transfer Protocol) defines how information is passed between a browser and a Web server The two most popular Web servers are Apache from Apache Software Foundation Internet Information Services (IIS) from Microsoft Almost two-thirds of all Web servers use Apache Netcraft.com
4
How a Web Server Works As is true with other servers such as DNS, Web servers listen for communication at a port The default port is 80 You can also create Web servers at port numbers greater than 1023 Each Web server has a root, which is where you store the HTML documents
5
Understanding HTTP The current version of HTTP is 1.1 Virtually no browsers are so old that they do not support 1.1 Version HTTP 2 has been worked on since 2006 HTTP is a stateless protocol, each Web page sent is independent of every other Web page shopping cart application uses programming
6
Understanding HTTP HTTP 1.1 supports persistent connections This allows the browser to receive multiple files in one TCP connection This can speed up communication Although you see a single page in your browser, it can be composed of many text and image files
7
Understanding HTTP When the browser sends a request to a Web server, it looks like: GET /hello.htm HTTP/1.1 Host: www.technowidgets.com The above requests the hello.htm file from the root of the Web server It specifies the host of www.technowidgets.com There could be multiple hosts at the IP address
8
Understanding HTTP Using a browser You type: www.edinboro.edu/hello.htm Browser contacts DNS to resolve IP address IP address sent back to browser Browser composes a message using IP address to port 80 (notice it includes the host name) GET /hello.htm HTTP/1.1 Host: www.edinboro.edu
9
Understanding HTTP Server www.edinboro.edu responds to browser – header contains page info HTTP/1.1 200 OK Server: Microsoft-IIS/8.5 Content-Type: text/html Last-Modified: Fri, 17 May 2014 18:21:25 GMT Content-Length: 43 Hello, World
10
Features in Apache Apache 2.4.12 released 1/29/2015 Apache can also be used as a proxy server A proxy server isolates your real Web server from the Internet Apache 2.0+ has (Apache Project)Apache Project Better support for Windows Support for IPv6 Simplified configuration Unicode support in Windows Multilanguage error responses Apache supports many programming languages such as Perl and PHP
11
Features in IIS IIS versions associated with Windows versions Windows Server 2003 – IIS 6.0 Windows 2008 – IIS 7.0 Windows 2012 – IIS 8.0 Windows 2012 R2 – IIS 8.5 SMTP can be easily added so you can send e-mail from your Web pages
12
Features in IIS 5.0 Web Distributed Authoring and Versioning (WebDAV) Allows a server to share Web-based files Named virtual hosting Multiple Web sites can share a single IP address Per Web site bandwidth throttling Control bandwidth by Web site Kerberos authentication Secure Sockets Layer 3.0 Encrypted communication
13
Features in IIS 6.0 Increased security Default permits only HTML documents Expanded language support Can use XML and SOAP Support for IPv6 Increased dependability Kernel-mode HTTP service Self-healing mechanism
14
Components in IIS File Transfer Protocol (FTP) server To transfer files between user and server FrontPage 2000 Server Extensions Used by programs to transfer files to and from a Web site NNTP Service Used to create user forums SMTP Service World Wide Web Server
15
IIS recent versions Wiki info Microsoft IIS
16
Installing Apache Apache can be installed when you install Linux Using yum install newest version: yum –y install httpd mod_ssl
17
Starting Apache By default, Apache does not start after you install it The following table has a list of commands apachectl – apache control ProcedureCommand Start Apache /usr/sbin/apachectl start Stop Apache /usr/sbin/apachectl stop Restart Apache /usr/sbin/apachectl restart
18
Minimal Apache Configuration Add a ServerName in /etc/httpd/conf/httpd.conf Find: #ServerName www.example:80 Add: ServerName your_domain.edu:80 Add apachectl start to /etc/rc.d/rc.local /usr/sbin/apachectl start
19
Apache Properties 3 Sections Global Section – Controls server overall operation Main Section – Configuration of default server Virtual Hosts Section – Settings for the virtual hosts
20
Apache Properties- Global Environment ServerRoot (“/etc/httpd”) Directory location of server files KeepAlive – (on) Indicates whether Apache should maintain a persistent connection Listen – (80) Determines the port number for the server Default is 80
21
Apache Properties- Main Server Configuration User (apache) Shows the user name that Apache employs when someone requests a Web page The default is apache ServerAdmin (root@localhost) E-mail address of administrator ServerName (www domain:80) DNS host name or IP address of server DocumentRoot (“var/www/html”) Directory where the Web pages are stored
22
Hosting Multiple Web Sites by Port Number Associate each new Web site with a port above 1023 To retrieve a Web page from a site at port 8080 www.technowidgets.com:8080/prod.htm Because it requires a user to add the port number, it is not a popular method
23
Hosting Multiple Web Sites by IP Address You can create multiple IP addresses on a single NIC Referred to as virtual IP addresses Useful for flexibility because if each domain has its own unique IP address, you can easily move the domain to a different Web server It is getting more expensive to get multiple IP addresses from an ISP
24
Hosting Multiple Web Sites by Host Name Multiple host names can be associated with a single IP address Getting a single IP address from your ISP is relatively inexpensive You can host an almost unlimited number of domains with a single IP address It is the most common method of hosting
25
Configuring a Virtual Host Based on an IP Address in Apache In /etc/rc.d/rc.local, add an IP address such as: /bin/ifconfig eth0:0 192.168.0.150 In the Virtual Host section of httpd.conf ServerName research.technowidgets.com DocumentRoot /var/www/research
26
Configuring a Virtual Host Based on a Host Name in Apache NameVirtualHost defines the common IP address Multiple configurations repeat the same IP address and define unique ServerName settings NameVirtualHost 192.168.0.100 ServerName www.technowidgets.com DocumentRoot /var/www/html ServerName web1.technowidgets.com DocumentRoot /var/www/web1
27
Configuring a Virtual Directory in Apache The following associates the virtual directory called prod with the location of the directory Alias /prod/ “/var/www/prod/” Then it configures the directory AllowOverride None Order allow, deny Allow from all
28
Summary Web servers use HTTP to send HTML documents IIS is from Microsoft while Apache is from Apache Software Foundation IIS modifications are made through property pages Apache modifications are typically made by changing /etc/httpd/conf/httpd.conf
29
Summary You can create multiple Web sites on a single computer by adding port numbers, IP addresses, and/or host names Virtual directories are directories that appear to be located beneath the root, yet are physically located elsewhere
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.