Archive

Posts Tagged ‘statistics’

Some photographic statistics

February 4th, 2011 No comments

This week, I decided to have a look at some statistics about photos I’ve taken with my Canon 450D. Using a little Perl magic, I extracted the EXIF data from almost 7,000 photos that I’ve taken since purchasing the camera 10 months ago.

The first graph shows the different focal lengths used in the photographs. Among my lenses, I have the ability to work between 8mm and 300mm. The three large spikes to the left are apparently where I’ve taken lots of photos with my primes, at 8mm, 50mm and 90mm. The general area of bars is my 18-55mm kit lens. Finally, the spike at the far right is the 70-300mm zoom lens, which I always seem to use at full zoom. (Incidentally, the EXIF data doesn’t record whether I used my 2× teleconverter, so some of the 300mm records should be 600mm).

What can I learn from this? Maybe that I would benefit from buying a longer zoom lens, but that’s a different story.

The graph of shutter speeds is perhaps more expected. Under “normal” conditions (where normal means outdoor daylight, or indoor flash photography) the shutter mainly gets used at decent everyday handheld speeds like 1/250 – 1/30. The sudden spike at 30″ is where I’ve used my camera for long-exposure night shots, including many of the night sky. My 450D doesn’t allow for anything longer than 30″ unless in bulb mode, where continuous drive doesn’t work.

And finally, we come to apertures. Clearly the most-used aperture setting is f/5.6. This is a sensible middling value, probably giving optimum sharpness for most of my lenses. It’s the kind of thing I’d choose in manual mode, and I bet the camera would readily choose it in semi-auto mode too.

f/1.8 is slightly more common than you might expect, and is probably from shooting in low light or where I’ve tried to maximise the depth of field.

Web statistics with AWstats

August 13th, 2009 No comments

A few months ago I set up a website, Memories of Korea, to showcase some slides I inherited. Naturally I was keen to find out how many visitors I’d had, so I set about finding something that could draw pretty graphs.

Based on my experiences setting up website statistics with AWstats, I’ve now prepared a guide for anyone else wishing to do the same.

This guide assumes you are running either Fedora or CentOS, with Apache httpd web server. The majority of the AWstats config will apply on any distro, and with several different web servers, but paths and installation procedures may vary.

Installing AWstats

First things first, let’s install AWstats. On Fedora:

sudo yum install awstats

On CentOS, you need to jump through a hoop first by enabling the EPEL repository:

sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
sudo yum install awstats

Tweaking your Apache logs

AWstats works by reading your httpd access logs. Somewhere in your httpd.conf you should have a line like this.

CustomLog logs/access_log common

or

CustomLog logs/access_log combined

If you have virtual servers, each server is likely to have its own log file and associated CustomLog directive, too. For now, just pick one set of logs to work with and do the rest later. If your CustomLog directive ends in common, change it to combined. This keeps the log format the same, but causes a couple of extra fields to be logged.

Don’t worry if you can’t change the log format for one reason or another – AWstats will still work but you won’t get quite as many juicy stats.

While you’re nosing around in httpd.conf, make a note of the path and filename of the access log – you’ll need it in a second. In my case it’s /var/log/access_log, which is the default for non-virtual Apache servers.

Go into /etc/awstats. There should be a sample config file called awstats.model.conf. This contains most of the default options you will need, so let’s make a copy of it and work on that. Give the copy the same name as your website

cp awstats.model.conf awstats.www.memoriesofkorea.com.conf
vi awstats.www.memoriesofkorea.com.conf

You don’t need to change many options to get it going, so I will outline the basics here. Find the following directives in the config file, and change their values appropriately. Leave everything else alone – for now!
Tell AWstats where your Apache log file is:

LogFile="/var/log/httpd/access_log"

Leave this as 1 if you are using combined Apache logs. Change it to 4 if you are using common Apache logs.

LogFormat=1

Set this to the main name of your website.

SiteDomain="www.memoriesofkorea.com"

If your website has other names, add them here. Usually the only “other” name is simply omitting the www. Leave in 127.0.0.1 and localhost, which may be important if you access your website from the server it is running on.

HostAliases="memoriesofkorea.com 127.0.0.1 localhost"

Save your changes and exit.

Run AWstats for the first time

When you installed AWstats, it was automatically configured to run and collect log information hourly, but you’re too impatient to wait for cron, run the first AWstats update now:

/usr/share/awstats/tools/awstats_updateall.pl now

Grant access to the AWstats page

You need to edit the file /etc/httpd/conf.d/awstats.conf. This just tells Apache who can view the statistics. Somewhere in the middle of the file there should be a block like the one below. By default only 127.0.0.1 (the web server itself) is allowed to view the page, so if your web browser isn’t running on the server, you will need to change something.

You might want to add a single IP address, an IP address range (e.g. 192.168.0.1/24 for a home network) or simply all to grant access to the world.

    Options None
    AllowOverride None
    Order allow,deny
    Allow from 127.0.0.1
    Allow from 192.168.0.0/24
    Allow from all

Save the file and exit. Restart Apache.

service httpd restart

See your statistics

Assuming all went well, you should be able to view your statistics page at http://www.mysite.com/awstats/awstats.pl

Other options

You no doubt saw in the /etc/awstats.conf file that there are many, many more configurable options for AWstats, including user authentication to name but one.

The config file is well commented and there is plenty of documentation online to help you along.