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
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
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
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
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
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
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