• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Tag Archives: Awstats

Modifying awstats to show total hits for matching files

November 3, 2011 1:22 pm / Albertech.net

Here’s a quick modification to awstats that allows you to add a totals field for the “Viewed – Full List” option. There isn’t a total hits field for matching files in awstats, so I added one to make it more useful. This makes it a lot quicker to total up hits for a specific folder, file type, or specific file in awstats.

Read More →

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: awstats, code, mods

awstats: Import old log files

September 3, 2009 11:26 am / Albertech.net

One thing I’ve encountered with Awstats is adding in old apache log files. This is useful if you are migrating data from servers. By default, Awstats will ignore ALL past dates in the log that occur before the most recent log entry date. In order to avoid Awstats from finding the “recent log entry date”, you will need move all Awstats cached files into a separate folder. I’ve verified that this works, so if you have any questions feel free to comment.

1) Locate your awstats data directory. Most commonly found in /var/lib/awstats

2) Create a new folder inside the directory. Move all awstats* files to the new folder.

3) Run  awstats update process on all log files in chronological order. AWStats will not complain about the “too old record” because there is no history files in DirData directory that contains compiled data more recent than record.

Edit the awstats.conf inside /etc/awstats
Locate the Apache logfile you need. It must be the oldest one you want to import. Awstats will chronologically add in the files, so make sure you add them in the right order. Edit the line starting with LogFile=”[log file location]”

Run the Awstats command (through the web browser or through shell via the perl command line)

4) Move the history files back. Once you process through all the logfiles, move the Awstats history files inside the /var/lib/awstats/newfolder back into /var/lib/awstats

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache, Linux / Tagged: Apache, awstats, import, old logs

awstats – remove image files

February 3, 2009 5:41 pm / Albertech.net

If you want to remove image files from your awstats reports, modify the SkipFiles variable in the /etc/awstats/awstats.conf (or awstats.YOURHOST.conf)

Do a search for “SkipFiles” in the file using nano/vi/emacs and find the section that talks about “Use SkipFiles to ignore access to URLs that match one of the following entries…” The SkipFiles line should look similar to the following:

SkipFiles="REGEX[.jpg$] REGEX[.gif$] REGEX[.png$]"

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: awstats, awstats.conf, remove images

Awstats setup in Debian

January 25, 2009 10:05 pm / Albertech.net

Installing awstats in Debian with GeoIP caching

First, use apt-get to get the software:

apt-get install awstats

Configure awstats:
Instead of using the awstats configure tool (written in Perl), manually add in the awstats Apache configuration. Using the tutorial from debuntu, make a file inside your apache config folder called awstats.conf with the following lines.

Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon/ "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch

Inside the Apache2.conf file (or virtual host conf file inside the sites-available folder) add this to the end of the file:

Include /etc/apache2/awstats.conf

Next, copy the /usr/lib/cgi-bin/awstats.pl file to the apache cgi-bin folder. If you have virtual hosts enabled, copy it to the cgi-bin located in the designated virtual hosts folder.

Configure the awstats.conf sample file located in /etc/awstats/awstats.conf
1) Set the LogFile to the server’s logfile directory (usually /var/log/apache2/access.log)
2) Set LogFormat to 1.
3) Set DNSLookup=0 (No DNS Lookup is necessary when you use GeoIP DB, instructions are below)
4) Uncomment this line (remove the # from the beginning)
LoadPlugin=”geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat”

Install GeoIP to speed up the hostname lookups. This will significanly improve the performance since DNS lookups will generally take a long time. Using this tutorial, install the GeoIP library:

wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gz

Download and extract the file.  Inside the GeoIP 1.4.5 folder, run:

./configure
make
make check
make install

Next, download the latest GeoIP perl module -and- latest GeoLite country database.
http://www.maxmind.com/download/geoip/api/perl/ I usually run wget to download the file from shell. wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.36.tar.gz

Extract the tar file and inside the Geo-IP folder, run:

perl Makefile.PL
make
make test
make install

GeoIP should now be installed. You can now generate the reports:
/usr/lib/cgi-bin/awstats.pl -config=[NAME OF YOUR INSTALL] -update
For instance, if you called the install “sample”, you should have a file called /etc/awstats/awstats.sample.conf    The command for sample would be:
/usr/lib/cgi-bin/awstats.pl -config=sample -update

To run awstats:
http://[SERVER]/cgi-bin/awstats.pl?config=[NAME OF YOUR INSTALL]

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache, Linux / Tagged: awstats, debian, geoIP

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.