Page 50 - Open Soource Technologies 304.indd
P. 50

Unit 4: Apache Server Installation in Window



               •  FileInfo? Directives controlling document types.                                Notes
               •  Indexes? Directives controlling directory indexing.
               •  Limit? Directives controlling host access.

               •  Options? Directives controlling specific directory features.
            You can control which of these directive groups can appear in perdirectory configuration files
            by using theAllowOverride directive. AllowOverride can also take an All or a None argument.
            All means that directives belonging to all groups can appear in the configuration file. None
            disables perdirectory files in a directory and any of its subdirectories. Listing 4 shows how to
            disable perdirectory configuration files for the server as a whole. This improves performance
            and is the default Apache configuration.

            Listing 4 Disabling PerDirectory Configuration Files
               1.  <Directory />
               2.  AllowOverride none

               3.  </Directory>

            4.3 Apache Log File

            One of the many pieces of the Website puzzle is Web logs. Traffic analysis is central to most
            Websites,  and  the  key  to  getting  the  most  out  of  your  traffic  analysis  revolves  around  how
            you configure your Web logs. Apache is one of the most if not the most powerful open source
            solutions for Website operations. You will find that Apache’s Web logging features are flexible
            for the single Website or for managing numerous domains requiring Web log analysis.

            For the single site, Apache is pretty much configured for logging in the default install. The initial
            httpd.conf file (found in/etc/httpd/conf/httpd.conf in most cases) should have a section on
            logs that looks similar to this (Apache 2.0.x), with descriptive comments for each item. Your
            default logs folder will be found in/etc/httpd/logs. This location can be changed when dealing
            with multiple Websites, as we’ll see later. For now, let’s review this section of log configuration.

            4.3.1 Error Logs
            The error log contains messages sent from Apache for errors encountered during the course of
            operation. This log is very useful for troubleshooting Apache issues on the server side.

            Apache Log Tip: If you are monitoring errors or testing your server, you can use the command
            line to interactively watch log entries. Open a shell session and type “tail –f /path/to/error_log”. This
            will show you the last few entries in the file and also continue to show new entries as they occur.

            There are no real customization options available, other than telling Apache where to establish
            the file, and what level of error logging you seek to capture. First, let’s look at the error log
            configuration code from httpd.conf.
            ErrorLog logs/error_log

            You may wish to store all error-related information in one error log. If so, the above is fine, even
            for multiple domains. However, you can specify an error log file for each individual domain
            you have. This is done in the <VirtualHost> container with an entry like this:




                                             LOVELY PROFESSIONAL UNIVERSITY                                    45
   45   46   47   48   49   50   51   52   53   54   55