
130
|
Chapter 6: Administering Apache
Any files and directories served by Apache need to be readable by this user and
group. Incorrect file and directory permissions are very common causes of Apache
errors, such as the inability to view a page (or the ability to view something that you
should not).
Listen directive
Apache normally responds to requests on TCP port 80, but you can direct it to listen
on other ports instead of, or in addition to, port 80. It’s common to use another port
for testing; many people use 81 because it’s easy to remember and not used for any-
thing else. To specify one or more ports, use one or more
Listen directives:
Listen 81
If you will be using SSL encryption for some pages, you’ll need to include this direc-
tive to use the standard secure web port:
Listen 443
DocumentRoot directive
Each web site has a document root, which is the directory that contains the site’s
content files and scripts. It’s specified with the
DocumentRoot directive. In the default
Debian Apache setup, this is specified in /etc/apache2/sites-enabled/000-default:
DocumentRoot /var/www/
Authentication and Authorization
Some parts of your web site may be open to the world, but you may want to restrict
other parts to certain visitors. Authentication determines who a visitor is. Authoriza-
tion determines what that visitor can do, such as:
• Read a file
• Use server-side includes
• Run a CGI program
• Generate an ...