Production use for the Include Directive
Simply create a new .conf file for the application and then use the apache Include directive to refer to the additional configuration file.
This idea is new to me--but it is not a new idea. I saw it after recently compiling a copy of apache on my own machine. It involves setting up separate configuration files per site, application, virtual server and just including them within the main apache configuration file.
Let's say you want to add php5 support into your apache server instance. Create a new configuration file that contains the following base configuration directives:
Then, in your httpd.conf file, add the following at the bottom:
LoadModule php5_module modules/libphp5.so # This section adds filetype support for php files <IfModule mod_php5.c> AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps </IfModule> # This enables index.php as a default directory document <IfModule mod_dir.c> DirectoryIndex index.html index.php </IfModule>
# Add PHP5 support into httpd.conf Include httpd-php5.conf
It's pretty useful when you get 5 or 6 (or more!) different applications that might have their own mod_rewrite statements, aliases, jk mounts, mod_proxy balancer statements or virtual hosts. apachectl -configtest will still run through each configuration file in order to check the syntax of all directives and you will wind up saving time hunting for application-specific configuration data--assuming, of course, that you used descriptive names for these additional files.