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

Open Source Technologies



                   Notes         <VirtualHost 10.0.0.2>
                                 DocumentRoot “/home/sites/domain1/html/”
                                 ServerName domain1.com
                                 ErrorLog /home/sites/domain1/logs/error.log
                                 </VirtualHost>
                                 If you are responsible for reviewing error log files as a server administrator, it is recommended
                                 that you maintain a single error log. If you’re hosting for clients, and they are responsible for
                                 monitoring the error logs, it’s more convenient to specify individual error logs they can access
                                 at their own convenience.

                                 The setting that controls the level of error logging to capture follows below:
                                 LogLevel warn
                                 Apache’s definitions for their error log levels are as follows:

                                                Level           Description
                                                Emerg           Emergencies-System is unusable
                                                alert           Action must be taken immediately
                                                Crit            Critical conditions
                                                Error           Error conditions
                                                Warn            Warning conditions
                                                Notice          Normal but significant condition
                                                Info            Informational
                                                Debug           Debug-level messages
                                 4.3.2 Apache Access Log File

                                 Apache server records all incoming requests and all requests processed to a log file. The format
                                 of the access log is highly configurable. The location and content of the access log are controlled
                                 by the CustomLog directive. Default apache access log file location:
                                    •  RHEL/Red  Hat/CentOS/Fedora  Linux  Apache  access  file  location  -/var/log/httpd/
                                      access_log

                                    •  Debian/Ubuntu Linux Apache access log file location -/var/log/apache2/access.log
                                    •  FreeBSD Apache access log file location -/var/log/httpd-access.log

                                 To find exact apache log file location, you can use grep command:
                                 # grep CustomLog /usr/local/etc/apache22/httpd.conf

                                 # grep CustomLog /etc/apache2/apache2.conf
                                 # grep CustomLog /etc/httpd/conf/httpd.conf

                                 Output

                                 # a CustomLog directive.
                                     #CustomLog “/var/log/httpd-access.log” common

                                     CustomLog “/var/log/httpd-access.log” combined





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