NOTE: For More Information
For an example of an Novell AppArmor profile, refer to
Example 5.1, “Example
phpsysinfo-dev Hat”
(page 81).
5.2 Configuring Apache for
mod_apparmor
Apache is configured by placing directives in plain text configuration files. The main
configuration file is usually
httpd.conf
. When you compile Apache, you can indicate
the location of this file. Directives can be placed in any of these configuration files to
alter the way Apache behaves. When you make changes to the main configuration files,
you need to start or restart Apache so the changes are recognized.
5.2.1 Virtual Host Directives
Virtual host directives control whether requests that contain trailing pathname informa-
tion following an actual filename or that refer to a nonexistent file in an existing direc-
tory are accepted or rejected. For Apache documentation on virtual host directives, refer
to
http://httpd.apache.org/docs-2.2/mod/core.html
#virtualhost
.
The ChangeHat-specific configuration keyword is
AADefaultHatName
. It is used
similarly to
AAHatName
, for example,
AADefaultHatName
My_Funky_Default_Hat
.
The configuration option is actually based on a server directive, which enables you to
use the keyword outside of other options, setting it for the default server. Virtual hosts
are considered internally within Apache to be separate “servers,” so you can set a default
hat name for the default server as well as one for each virtual host, if desired.
When a request comes in, the following steps reflect the sequence in which
mod_apparmor
attempts to apply hats.
1.
A location or directory hat as specified by the
AAHatName
keyword
Profiling Your Web Applications Using ChangeHat
83