Configuring Apache 2.0 -- Beginning - Directory Setup
(Page 4 of 5 )
As I mentioned above, setting up Apache requires you to define your own virtual file system that will be exposed on the Web. This is the most important part for maintaining security on your Web server. You use the <Directory> and </Directory> tags to delineate the different permissible actions that each directory has on the server. For instance, to configure options for the directory /www/PubDocs you would use the tag <Directory “/www/PubDocs”> and </Directory>. You must set up directory tags to define the options for all the directories on your server. You should set up at least two directory tags. One is for the actual root “/” and another is for the directory you have specified in the “DocumentRoot” directive.
Each directory tag has an “Options” component. This is what determines the different capabilities assigned to each directory. The allowed arguments to the Options line are: “Indexes”; “FollowSymLinks”; “SymLinksIfOwnerMatch”; “MultiViews”; “ExecCGI”; “Includes”; “IncludesNoExec”; “None”; and “All.” Most of these are outside the purview of this article since they deal with relatively complex parts of server operation; however, several are relatively simple.
The “Indexes” option tells the server to generate an index page for a directory if none exists. This is useful if you wish to set up a directory where people can go to download all the files in a directory without trying to maintain an HTML file yourself that links to all the files in that directory. Remember, this will index all the files in a directory, so everything will be easily accessible. The options “ExecCGI”, “Includes”, and “IncludesNoExec” are associated with different types of server side scripting. “MultiViews” allows the server to attempt to decide which page is best for a specific browser. This is often used for pages written in multiple languages, and allows the server to determine which version is best suited to a specific client.
Several other lines are useful within directory tags. “AllowOverride” tells whether or not authenticated users are allowed different access to a directory. This should generally be set to “None” and should always be set to “None” on the root directory.
Along with the <Directory> tag, there is also a <Files> tag used for configuring access to specific files or groups of files. Most likely, you won’t ever have to deal with this, but it is useful to know it exists.
More Web Hosting How-Tos Articles
More By Michael Swanson