See the Mailing Lists Page for how to subscribe and unsubscribe.
eprints_tech messages
Please note: this page shows emails that have been sent to the eprints_tech mailing list. Some of these may be spam emails we have failed to filter.
[EP-tech] IRStats on EPrints 3 - populating irstats tables ?
From: Edward Craft <e.j.craft AT bham.ac.uk>
Date: Mon, 21 Jul 2008 13:12:14 +0100
| Threading: | ↑ Re: [EP-tech] IRStats on EPrints 3 howto from roman.chyla AT gmail.com • This Message |
*** ↵ http://www.eprints.org/tech.php/id/%3CEMEW-k6KDCF31d60398e1ca18e57e8682b2fdfe0431-F0BEFA7AEB684E41ABFF145F897C444FDA39CA%40EM4.adf.bham.ac.uk%3E *** EPrints community wiki - http://wiki.eprints.org/ Hi, These instructions are great and should certainly replace the out-of-date info on the Eprints site !! However ... Is anyone else having a problem populating their irstats_ tables ? I've installed IRStats on our test repository and all the Views are returning no data. MySQL says our access table has 48,022 rows which is about right. After running the irstats_update_metadata (takes a few seconds to run) and irstats_update_data scripts (suspiciously executes/returns to prompt immediately), the itstats_ tables have : | irstats_column_referent_id 0 rows | irstats_column_referrer_scope 0 rows | irstats_column_referrering_entity_id 0 rows | irstats_column_referring_entity_id 0 rows | irstats_column_requester_host 0 rows | irstats_column_requester_institution 0 rows | irstats_column_requester_organisation 0 rows | irstats_column_search_engine 0 rows | irstats_column_search_terms 0 rows | irstats_column_service_type_id 0 rows | irstats_phrases 0 rows | irstats_set_eprint 123 rows (about right also) | irstats_set_eprint_citation 123 rows | irstats_set_eprint_code 123 rows | irstats_true_accesses_table 0 rows The IRStats wiki has a low traffic discussion board where a couple of people have also had this problem but their posts have had no replies. The irstats.cgi's --verbose parameter doesn't seem to add anything to the output. Anyone else had a similar problem ? Thanks, Edward. Edward Craft Digital Library Systems Specialist Information Services University of Birmingham e.j.craft AT bham.ac.uk On Tue, Jul 8, 2008 at 4:42 PM, Dennis - UT <dv.eprints AT gmail.com> wrote: > Hi folks, > > I noticed some people were asking questions on this list regarding to > getting IRStats running with EPrints. I finally managed to get it > working on our repository server. In order to save you guys > (hopefully) a lot of effort (and frustrations!) I will share my > installation guide here. Some of this should probably end up in a > manual on the IRStats or EPrints wiki, the current IRStats documentation is severely wanting. > > This guide makes a few assumptions: > 1. EPrints3 is used > 2. EPrints3 is installed in /opt/eprints3 3. We use SUSE Linux > Enterprise server 9, it should work similar on most other linux > distributions 4. The server is running multiple repositories using one > EPrints, it took some path changes in the config files to get this > working, it works equally well with only one repository though 5. > IRStats will use the same database as the repository itself; IRStats > uses table prefixes by default so it shouldn't lead to any conflicts > 6. IRStats will be accessible through the repository URL itself, > followed by /irstats.cgi, so you won't need to setup a separate > virtual host for IRStats > > The examples below use a repository called 'myrepository', replace > these with your repository name. > > Don't hesitate to ask if there are any further questions! > > Dennis > University of Twente > > P.s. I hope the list server / email clients are not going to screw > this thing up with loads of forced lines breaks... if it does, I could > resend it as an attachment... > > ----------------------------------------- > > ====== IRStats ====== > > ===== Install AWStats ===== > > * Download AWStats: http://awstats.sourceforge.net/ > * Extract AWStats to: /usr/local/awstats > > It seems that AWStats only needs to be unpacked in the right folder, > it doesn't seem to be necessary to actually configure AWStats and get > it working. IRStats only uses AWStat's Perl libraries. > > ===== Additional system tools ===== > > Make sure you have these installed on your system (using yast or such): > * autoconf > * automake > > ===== Additional Perl Modules ===== > > Use cpan to install additional Perl Modules (required for IRStats): > > install Date::Calc > install Logfile::EPrints > install Geo::IP::PurePerl > > ===== ChartDirector ===== > > Optional! It's also possible to use PlotKit (included in the IRstats > distribution). Plotkit's graphs don't work on IE though (not without > extra plugins that is). > > * Download chartdir_perl_linux.tar.gz from http://www.advsofteng.com/ > * Extract chartdir_perl_linux.tar.gz into a temporary folder > * Copy all files from chartdirector/lib/ to /usr/local/lib/ChartDirector/ > * Add the license file to /usr/local/lib/ChartDirector/ > > Ask the EPrints guys for the ChartDirector license file for IRStats, > make sure to thank them for making EPrints such a great product ;-) > > ===== GeoIP database file ===== > > * Download GeoIP.dat.gz from > http://www.maxmind.com/download/geoip/database/ and extract the file > (GeoIP.dat) into /usr/local/share/GeoIP/ > > TODO: this file should be updated regularly. Perhaps add an automated > download script (using wget or curl) to cron.monthly? > > ===== IRStats installation ===== > > Download IRStats from > http://trac.eprints.org/projects/irstats/wiki/Download > and extract the files into a temporary folder. > > Run the following commands to configure, build and install IRStats: > > autoconf > ./configure --prefix=/ > make > make install > > This will install: > * irstats.conf in /etc > * irstats code and html files in /var/www/irstats > * irstats cache files in /var/cache/irstats > > > ===== IRStats configuration ===== > > ("A -> B" means change A to B) > > * Modify /var/www/cgi-bin/irstats.cgi: > > use lib "/var/www/awstats/lib"; > -> > use lib "/usr/local/awstats/wwwroot/cgi-bin/lib"; > > use lib "/usr/lib/ChartDirector"; > -> > use lib "/usr/local/lib/ChartDirector"; > > use lib "/opt/eprints2/perl_lib"; > -> > use lib "/opt/eprints3/perl_lib"; > > * Rename /etc/irstats.conf to /etc/irstats.conf.template > * Modify /etc/irstats.conf.template (this will be the template for > repository specific configurations): > * repository_type = eprints3 > * set_ids = > * #geo_ip_org_file = ... //<- comment out this line// > * #creators_id_field = creators_empid //<- comment out this line// > * max_cache_age = 86400 > * Copy /etc/irstats.conf.template to /etc/irstats.myrepository.conf > * Modify /etc/irstats.myrepository.conf: > * repository = myrepository > * repository_url = http://myrepository.org > * database_name = databasename //(use the database name from the > eprints archive config: /opt/eprints3/archives/myrepository/cfg/cfg.d/database.pl)// > * database_user = <usernamename> //(use the username from the > eprints archive config: /opt/eprints3/archives/myrepository/cfg/cfg.d/database.pl)// > * database_password = <password> //(use the password from the > eprints archive config: > /opt/eprints3/archives/myrepository/cfg/cfg.d/database.pl))// > * cache_path = /var/cache/irstats/myrepository/stats > * data_path = /var/cache/irstats/myrepository > * dns_cache_file = /var/cache/irstats/myrepository/dns_cache > * repeats_filter_file = /var/cache/irstats/myrepository/repeatscache > * Create the repository specific folders: > > mkdir /var/cache/irstats/myrepository > mkdir /var/cache/irstats/myrepository/stats > chmod 777 /var/cache/irstats/myrepository chmod 777 > /var/cache/irstats/myrepository/stats > > * Modify /opt/eprints3/archives/myrepository/cfg/cfg.d/urls.pl: > > $c->{rewrite_exceptions} = [ '/cgi/', ...other existing exceptions... > ]; > -> > $c->{rewrite_exceptions} = [ '/cgi/', ...other existing exceptions..., > '/irstats/', '/irstats.cgi' ]; > > * Add to /opt/eprints3/archives/myrepository/cfg/apachevhost.conf: > > # irstats html section start > Alias /irstats/ /var/www/html/irstats/ <Directory > "/var/www/html/irstats"> > Order allow,deny > Allow from all > </Directory> > # irstats html section end > > * Add to the **end** of > /opt/eprints3/archives/myrepository/var/apachevhost.conf, just before > "</VirtualHost>": //Warning: this file is auto generated, ↵ it should > not be edited, however there doesn't seem to be a way to avoid it > now.// > > # irstats perl section start > PerlRequire /var/www/cgi-bin/irstats.cgi <Location /irstats.cgi> > SetHandler perl-script > PerlSetVar IRStats_Config_File /etc/irstats.myrepository.conf > PerlHandler IRStats::GUI > PerlSendHeader On > </Location> > # irstats perl section end > > * Restart apache: /etc/init.d/apache2 restart //(depending on your > linux distro)// > > ===== Running IRStats ===== > > To automatically update the statistics data on a daily base: > > Create a file /etc/cron.daily/irstats_update_data containing: > > #!/bin/bash > sudo -u eprints /var/www/cgi-bin/irstats.cgi --config > /etc/irstats.myrepository.conf update_table sudo -u eprints > /var/www/cgi-bin/irstats.cgi --config /etc/irstats.myrepository.conf > convert_ip_to_host > > > Make the script executable: > > chmod ugo+x /etc/cron.daily/irstats_update_data > > > To automatically update eprint metadata on a daily base: > > > Create a file /etc/cron.daily/irstats_update_metadata containing: > > #!/bin/bash > sudo -u eprints /var/www/cgi-bin/irstats.cgi --config > /etc/irstats.myrepository.conf extract_metadata_from_archive sudo -u > eprints /var/www/cgi-bin/irstats.cgi --config > /etc/irstats.myrepository.conf import_metadata > > > Make the script executable: > > chmod ugo+x /etc/cron.daily/irstats_update_metadata > > > ==== Web access ==== > > You can access the IRStats dashboard through: > > http://myrepository.org/irstats.cgi > > ====== Integrating IRStats in your repositories ====== > > ===== Abstract pages ===== > > To add the "daily downloads in the past month" and the ↵ "monthly > downloads in the past year" statistics to each abstract page and the index page: > > Add to /opt/eprints3/archives/myrepository/cfg/cfg.d/eprint_render.pl: > > # IRStats for this eprint > my $irstats = $session->make_element( "div", class=>"ep_block_left" ); > my $irstatsLastMonthLink = "/irstats.cgi?page=last_month&set=eprint_" . > $eprint->get_value( "eprintid" ); > my $irstatsLastMonthImg = $session->make_element( "img", > src=>$irstatsLastMonthLink ); > my $irstatsLastYearLink = "/irstats.cgi?page=last_year&set=eprint_" . > $eprint->get_value( "eprintid" ); > my $irstatsLastYearImg = $session->make_element( "img", > src=>$irstatsLastYearLink ); > $irstats->appendChild( $session->html_phrase( > "page:irstats", > img_last_month => $irstatsLastMonthImg, > img_last_year => $irstatsLastYearImg ) ); > $page->appendChild( $irstats ); > > Just before: > unless( $preview ) > { > # Add a link to the edit-page for this record. Handy for staff. > ... > > > Add to > /opt/eprints3/archives/myrepository/cfg/lang/en/phrases/render.xml, > just before "</epp:phrases>": > > <epp:phrase id="page:irstats"><h2>Download ↵ statistics</h2><p><epc:pin > name="img_last_month"/></p><p><epc:pin > name="img_last_year"/></p></epp:phrase> > > > Add to > /opt/eprints3/archives/myrepository/cfg/lang/en/static/index.xpage, > just before "</xpage:body>": > > <h2>Download statistics</h2> > <p><img src="/irstats.cgi?page=last_month" ↵ /></p> <p><img > src="/irstats.cgi?page=last_year" /></p> > > > Regenerate abstracts and static files using: > > sudo -u eprints /opt/eprints3/bin/generate_abstracts myrepository sudo > -u eprints /opt/eprints3/bin/generate_static myrepository > > Done! >
[index] [prev] [next] [options] [help]




