Defining File Types
MIME file types and file extensions play a major role in helping the server determine how a file should be handled. Specifying MIME options is also a major part of the httpd.conf file. The options involved are the following:
DefaultType Defines the MIME type that is used when the server cannot determine the type of a file. By default, this is set to text/html. Thus, when a file has no file extension, the server assumes that it is an HTML file.
AddEncoding Maps a MIME encoding type to a file extension. The Red Hat configuration contains two AddEncoding directives:AddEncoding x-compress Z AddEncoding x-gzip gz tgzThe first directive maps the file extension .Z to the MIME encoding type x-compress. The second line maps the file extensions .gz and .tgz to MIME encoding type x-gzip.
AddLanguage Maps a MIME language type to a file extension.
LanguagePriority Sets the language encoding in case the client does not specify a preference.
AddType Maps a MIME file type to a file extension.
AddHandler Maps a file handler to a file extension. A file handler is a program that knows how to process a file. Simple examples of this are cgi-script, which is the handler for CGI files; and server-parsed, which handles Server Side Includes (SSI). (Both SSI and CGI are covered more later.)
In this tutorial:
- Apache Web Server
- Installing Apache
- Running httpd
- Configuring the Apache Server
- The httpd.conf File
- Loading Dynamic Shared Objects
- Basic Server Directives
- Multi-Homed Server Configuration
- Defining Where Things Are Stored
- Creating a Fancy Index
- Defining File Types
- Managing Child Processes
- Performance Tuning Directives
- Caching Directives
- Defining Virtual Hosts
- Web Server Security
- The CGI and SSI Threat
- Server Options for Documents and Directories
- Directory-Level Configuration Controls
- Defining Access Controls
- Requiring User Authentication
- High-Performance User Authentication
- Configuring SSL
- Managing Your Web Server
- Monitoring Your Server
- Apache Logging
- Defining Log Formats
- Using Conditional Logging