Apache
This readme’s intent is to show a configuration for a virtual site with configuration emphasis on support for the “awstats” statistical reporting application. Items in italics are the specific entries/modifications needed for “awstats” reporting.
Prerequisites:
- the apache rpm has been installed
- the awstats rpm has been installed
Configuration Assumptions:
- your site is www.mysite.org
- you are configuring a blog site – important because of the “DirectoryIndex” attribute noted later
- you are using the default location for Apache rpm – /var/www/html
- awstats is installed from an rpm (see the awstats readme)
- after making the noted changes to httpd.conf file it is necessary to restart apache: service httpd restart
Make a copy of the Apache file httpd.conf so that if you muck it up you can start over. This standard configuration file will be modified with the bulk of the changes below added to the end of the file httpd.conf. There is one exception: remove the # from the following line in the httpd.conf file.
#LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\” %I %O” combinedio
You need your Apache logs to use this format or “awstats will not produce all the information it is capable of producing and you will force a configuration change within the “awstats” package because it is expecting “combined” format and not the “common” format.
The following code is added to the end of the httpd.conf file.
#
# virtual host for www.mysite.org blog
#
<VirtualHost *:80>
ServerName www.mysite.org
ServerAlias mysite.org *.mysite.org
DocumentRoot /var/www/html
ServerAdmin webmaster@mysite.org
Alias /awstatsclasses “/usr/share/awstats/wwwroot/classes/”
Alias /awstatscss “/usr/share/awstats/wwwroot/css/”
Alias /awstatsicons “/usr/share/awstats/wwwroot/icon/”
ScriptAlias /awstats/ “/usr/share/awstats/wwwroot/cgi-bin/”
ErrorLog /var/log/httpd/mysite.error_log
# note the “combined” entry on the next line.
CustomLog /var/log/httpd/mysite.access_log combined
<Directory “/var/www/html”>
DirectoryIndex index.php
Options FollowSymlinks
AddType application/x-httpd-php .php .phtml
AllowOverride ALL
</Directory>
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory “/usr/share/awstats/wwwroot”> Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Entries (RSS)