0% found this document useful (0 votes)
69 views

05 The HTTP Service

http

Uploaded by

Venu Gopal
Copyright
© © All Rights Reserved
0% found this document useful (0 votes)
69 views

05 The HTTP Service

http

Uploaded by

Venu Gopal
Copyright
© © All Rights Reserved
You are on page 1/ 18

Certification

The HTTP Service


UNIT 5

The HTTP Service

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Objectives
• Learn the major features of the Apache
HTTP server
• Be able to configure important Apache
parameters
• Learn per-directory configuration
• Learn how to use CGI with Apache
• Identify key modules
• Understand proxy web servers 2

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Agenda
• Introduce Apache Features
• Apache configuration files and important
parameters
• Using CGI with Apache
• Key modules
• Squid proxy server

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Overview
• Process control:
• spawn processes before needed
• adapt number of processes to demand
• Dynamic module loading:
• run-time extensibility without recompiling
• Virtual hosts:
• Multiple web sites may share the same
web server
4

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Service Profile: HTTPD
• Type: SystemV-managed service
• Packages: httpd, httpd-devel
• Daemons: httpd
• Script: httpd
• Ports: 80(http), 443(https)
• Configuration: /etc/httpd/*, /var/www/*
• Related: redhat-config-httpd, mod_ssl

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Configuration
• Main server configuration stored in
/etc/httpd/conf/httpd.conf
• controls general web server parameters,
regular virtual hosts, and access
• defines filenames and mime-types
• Module configuration files stored in
/etc/httpd/conf.d/*
• DocumentRoot default
• /var/www/html/
6

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Server Configuration
• Min and Max Spare Servers
• Log file configuration
• Host name lookup
• Modules
• Virtual Hosts
• user/group

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Virtual Hosts
<VirtualHost 192.168.0.100>
ServerName virt1.com
DocumentRoot /path-to-document-root
</VirtualHost>

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Namespace
Configuration
• Specifying a directory for users' pages:
UserDir public_html
• MIME types configuration:
AddType application/x-httpd-php .phtml
AddType text/html .htm
• Declaring index files for directories:
DirectoryIndex index.html default.htm

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Access Configuration
• Apache provides directory- and file-level host-
based access control
• Host specifications may include dot notation
numerics, network/netmask, and dot notation
hostnames and domains
• The Order statement provides control over
"order", but not always in the way one might
expect

10

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Using .htaccess Files
• Change a directory's configuration:
• add mime-type definitions
• allow or deny certain hosts
• Setup user and password databases:
• AuthUserFile directive
• htpasswd command:
htpasswd -c /etc/httpd/mypasswd bob

11

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


CGI
• CGI programs are restricted to separate
directories by ScriptAlias directive:
ScriptAlias /cgi-bin/ /<path>/cgi-bin/
• Apache can greatly speed up CGI
programs with loaded modules such as
mod_perl

12

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Notable Apache Modules
• mod_perl
• mod_php
• mod_speling

13

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Apache Encrypted Web Server
• Apache and SSL: https (port 443)
• mod_ssl
• /etc/httpd/conf.d/ssl.conf
• Encryption Configuration:
• certificate: conf/ssl.crt/server.crt
• private key: conf/ssl.key/server.key
• Certificate/key generation:
• /usr/share/ssl/certs/Makefile
• self-signed cert: make testcert
• certificate signature request: make certreq
14

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Squid Web Proxy Cache
• Squid supports caching of FTP, HTTP, and
other data streams
• Squid will forward SSL requests directly to
origin servers or to one other proxy
• Squid includes advanced features including
access control lists, cache hierarchies, and
HTTP server acceleration

15

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


Service Profile: Squid
• Type: SystemV-managed service
• Packages: squid
• Daemons: squid
• Script: squid
• Ports: 3128(squid), (configurable)
• Configuration: /etc/squid/*

16

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.


End of Unit 5
• Address questions
• Preparation for Lab 5
• Goals
• Scenario
• Deliverables
• Please ask the instructor for assistance
when needed

17

Rev RH253-RHEL-1 Copyright © 2003 Red Hat, Inc.

You might also like