Bug#644041: Couldn't open file "/usr/lib/cgi-bin/awstats102011.model.tmp.5639" for write: Permission denied

October 02nd, 2011 - 03:50 am ET by Rainer Dorsch | Report spam
Package: awstats
Version: 6.9.5~dfsg-5
Severity: important


After the upgrade to squeeze I get an error from this cron entry:

*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh

Running it manually, I get

bokomoko:/etc/awstats# su - www-data /usr/share/awstats/tools/update.sh
Create/Update database for config "/etc/awstats/awstats.model.conf" by AWStats version 6.95 (build 1.943)

From data in log file "/var/log/apache2/access.log"...


Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 13271)
Error: Couldn't open file "/usr/lib/cgi-bin/awstats102011.model.tmp.10096" for write: Permission denied
Setup ('/etc/awstats/awstats.model.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
bokomoko:/etc/awstats#

I queried google for this message and found a few hits, but there was no conclusive solution for the problem.

Please let me know if you need further information.

When I run update.sh as root, it runs flawless.

Many thanks,
Rainer


Debian Release: 6.0.2
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-028stab092.1 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages awstats depends on:
ii perl 5.10.1-17squeeze1 Larry Wall's Practical Extraction

Versions of packages awstats recommends:
ii coreutils 8.5-1 GNU core utilities
pn libnet-xwhois-perl <none> (no description available)

Versions of packages awstats suggests:
ii apache2 2.2.16-6+squeeze1 Apache HTTP Server metapackage
ii apache2-mpm-prefork [h 2.2.16-6+squeeze1 Apache HTTP Server - traditional n
pn libgeo-ipfree-perl <none> (no description available)
ii libnet-dns-perl 0.66-2 Perform DNS queries from a Perl sc
ii libnet-ip-perl 1.25-2 Perl extension for manipulating IP
ii liburi-perl 1.54-2 module to manipulate and access UR

/etc/awstats/awstats.conf changed:
LogFile="/var/log/apache2/access.log"
LogType=W
LogFormat=4
LogSeparator=" "
SiteDomain="bokomoko.de"
HostAliases="localhost 127.0.0.1"
DNSLookup=1
DirData="/var/lib/awstats"
DirCgi="/cgi-bin"
DirIcons="/awstats-icon"
AllowToUpdateStatsFromBrowser=0
AllowFullYearView=2
EnableLockForUpdate=0
DNSStaticCacheFile="dnscache.txt"
DNSLastUpdateCacheFile="dnscachelastupdate.txt"
SkipDNSLookupFor=""
AllowAccessFromWebToAuthenticatedUsersOnly=0
AllowAccessFromWebToFollowingAuthenticatedUsers=""
AllowAccessFromWebToFollowingIPAddresses=""
CreateDirDataIfNotExists=0
BuildHistoryFormat=text
BuildReportFormat=html
SaveDatabaseFilesWithPermissionsForEveryone=0
PurgeLogFile=0
ArchiveLogRecords=0
KeepBackupOfHistoricFiles=0
DefaultFile="index.php index.html"
SkipHosts=""
SkipUserAgents=""
SkipFiles=""
SkipReferrersBlackList=""
OnlyHosts=""
OnlyUserAgents=""
OnlyUsers=""
OnlyFiles=""
NotPageList="css js class gif jpg jpeg png bmp ico rss xml swf"
ValidHTTPCodes="200 304"
ValidSMTPCodes="1 250"
AuthenticatedUsersNotCaseSensitive=0
URLNotCaseSensitive=0
URLWithAnchor=0
URLQuerySeparators="?;"
URLWithQuery=0
URLWithQueryWithOnlyFollowingParameters=""
URLWithQueryWithoutFollowingParameters=""
URLReferrerWithQuery=0
WarningMessages=1
ErrorMessages=""
DebugMessages=0
NbOfLinesForCorruptedLogP
WrapperScript=""
DecodeUA=0
MiscTrackerUrl="/js/awstats_misc_tracker.js"
LevelForBrowsersDetection=2 # 0 disables Browsers detection.
# 2 reduces AWStats speed by 2%
# allphones reduces AWStats speed by 5%
LevelForOSDetection=2 # 0 disables OS detection.
# 2 reduces AWStats speed by 3%
LevelForRefererAnalyze=2 # 0 disables Origin detection.
# 2 reduces AWStats speed by 14%
LevelForRobotsDetection=2 # 0 disables Robots detection.
# 2 reduces AWStats speed by 2.5%
LevelForSearchEnginesDetection=2 # 0 disables Search engines detection.
# 2 reduces AWStats speed by 9%
LevelForKeywordsDetection=2 # 0 disables Keyphrases/Keywords detection.
# 2 reduces AWStats speed by 1%
LevelForFileTypesDetection=2 # 0 disables File types detection.
# 2 reduces AWStats speed by 1%
LevelForWormsDetection=0 # 0 disables Worms detection.
# 2 reduces AWStats speed by 15%
UseFramesWhenCGI=1
DetailedReportsOnNewWindows=1
Expires=0
MaxRowsInHTMLOutput00
Lang="auto"
DirLang="/usr/share/awstats/lang"
ShowMenu=1
ShowSummary=UVPHB
ShowMonthStats=UVPHB
ShowDaysOfMonthStats=VPHB
ShowDaysOfWeekStats=PHB
ShowHoursStats=PHB
ShowDomainsStats=PHB
ShowHostsStats=PHBL
ShowAuthenticatedUsers=0
ShowRobotsStats=HBL
ShowWormsStats=0
ShowEMailSenders=0
ShowEMailReceivers=0
ShowSessionsStats=1
ShowPagesStats=PBEX
ShowFileTypesStats=HB
ShowFileSizesStats=0
ShowOSStats=1
ShowBrowsersStats=1
ShowScreenSizeStats=0
ShowOriginStats=PH
ShowKeyphrasesStats=1
ShowKeywordsStats=1
ShowMiscStats=a
ShowHTTPErrorsStats=1
ShowSMTPErrorsStats=0
ShowClusterStats=0
AddDataArrayMonthStats=1
AddDataArrayShowDaysOfMonthStats=1
AddDataArrayShowDaysOfWeekStats=1
AddDataArrayShowHoursStats=1
IncludeInternalLinksInOriginSection=0
MaxNbOfDomain = 10
MinHitDomain = 1
MaxNbOfHostsShown = 10
MinHitHost = 1
MaxNbOfLoginShown = 10
MinHitLogin = 1
MaxNbOfRobotShown = 10
MinHitRobot = 1
MaxNbOfPageShown = 10
MinHitFile = 1
MaxNbOfOsShown = 10
MinHitOs = 1
MaxNbOfBrowsersShown = 10
MinHitBrowser = 1
MaxNbOfScreenSizesShown = 5
MinHitScreenSize = 1
MaxNbOfWindowSizesShown = 5
MinHitWindowSize = 1
MaxNbOfRefererShown = 10
MinHitRefer = 1
MaxNbOfKeyphrasesShown = 10
MinHitKeyphrase = 1
MaxNbOfKeywordsShown = 10
MinHitKeyword = 1
MaxNbOfEMailsShown = 20
MinHitEMail = 1
FirstDayOfWeek=1
ShowFlagLinks=""
ShowLinksOnUrl=1
UseHTTPSLinkForUrl=""
MaxLengthOfShownURLd
HTMLHeadSection=""
HTMLEndSection=""
MetaRobot=0
Logo="awstats_logo6.png"
LogoLink="http://awstats.sourceforge.net"
BarWidth = 260
BarHeight = 90
StyleSheet=""
color_Background="FFFFFF" # Background color for main page (Default = "FFFFFF")
color_TableBGTitle="CCCCDD" # Background color for table title (Default = "CCCCDD")
color_TableTitle="000000" # Table title font color (Default = "000000")
color_TableBG="CCCCDD" # Background color for table (Default = "CCCCDD")
color_TableRowTitle="FFFFFF" # Table row title font color (Default = "FFFFFF")
color_TableBGRowTitle="ECECEC" # Background color for row title (Default = "ECECEC")
color_TableBorder="ECECEC" # Table border color (Default = "ECECEC")
color_text="000000" # Color of text (Default = "000000")
color_textpercent="606060" # Color of text for percent values (Default = "606060")
color_titletext="000000" # Color of text title within colored Title Rows (Default = "000000")
color_weekend="EAEAEA" # Color for week-end days (Default = "EAEAEA")
color_link="0011BB" # Color of HTML links (Default = "0011BB")
color_hover="605040" # Color of HTML on-mouseover links (Default = "605040")
color_u="FFAA66" # Background color for number of unique visitors (Default = "FFAA66")
color_v="F4F090" # Background color for number of visites (Default = "F4F090")
color_p="4477DD" # Background color for number of pages (Default = "4477DD")
color_h="66DDEE" # Background color for number of hits (Default = "66DDEE")
color_k="2EA495" # Background color for number of bytes (Default = "2EA495")
color_s="8888DD" # Background color for number of search (Default = "8888DD")
color_e="CEC2E8" # Background color for number of entry pages (Default = "CEC2E8")
color_x="C1B2E2" # Background color for number of exit pages (Default = "C1B2E2")
LoadPlugin="hashfiles"
ExtraTrackedRowsLimitP0
Include "/etc/awstats/awstats.conf.local"

/etc/awstats/awstats.conf.local changed:
LogFile="/var/log/apache2/access.log"
LogFormat=1
SiteDomain="bokomoko.de"
HostAliases="bokomoko.de localhost 127.0.0.1"

/etc/cron.d/awstats changed:





To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 3 repliesReplies Make a reply

Similar topics

Replies

#1 Sergey B Kirpichev
October 02nd, 2011 - 04:00 am ET | Report spam
tags 644041 +unreproducible +moreinfo

On Sun, Oct 2, 2011 at 11:45 AM, Rainer Dorsch wrote:
After the upgrade to squeeze I get an error from this cron entry:

*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh

Running it manually, I get

bokomoko:/etc/awstats# su - www-data /usr/share/awstats/tools/update.sh
Create/Update database for config "/etc/awstats/awstats.model.conf" by AWStats version 6.95 (build 1.943)
>From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 13271)
Error: Couldn't open file "/usr/lib/cgi-bin/awstats102011.model.tmp.10096" for write: Permission denied
Setup ('/etc/awstats/awstats.model.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
bokomoko:/etc/awstats#



Please, quote /etc/awstats/awstats.model.conf and (if you can) your
old cron.d file.



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#2 Sergey B Kirpichev
October 02nd, 2011 - 10:10 am ET | Report spam
I attached /etc/awstats/awstats.model.conf



The source of your problem is in your local customization, e.g. line:
DirData="."
This should be
DirData="/var/lib/awstats/"

Please, use the standard awstats conf and override some
options only if you need them. And see README.Debian for
some hints in handling multiple stats (a number of apache vhosts).

unfortunately I threw away the old
cron.d file (it was still lying around in /etc/cron.d/awstats.dpkg-old, and I
was not sure if it was the source of the problem).



dpkg-old and dpkg-dist are filename extensions that are created when
a package is upgraded and a conffile overwritten. <conffilename>.dpkg-old is
created when the user has chosen to use the newly installed one. 
<conffilename>.dpkg-dist is created when the user opted to
keep the old one; it is the version from the newer package.

If you restore /etc/cron.d/awstats.dpkg-old and leave /etc/awstats/*
stuff intact - your old config should be working.



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#3 Rainer Dorsch
October 02nd, 2011 - 02:10 pm ET | Report spam

Sergey,

Am Sunday, 2. October 2011 schrieb Sergey B Kirpichev:
> I attached /etc/awstats/awstats.model.conf

The source of your problem is in your local customization, e.g. line:
DirData="."
This should be
DirData="/var/lib/awstats/"

Please, use the standard awstats conf and override some
options only if you need them. And see README.Debian for
some hints in handling multiple stats (a number of apache vhosts).



Many thanks for pointing that out. I cannot tell why I introduced
awstats.model.conf in the first place (as I said, I upgraded, i.e. I configured
awstats long time ago). Right now I have only one apache host and I think I
can go without it (?).

Note, I most likely cloned awstats.model.conf from (the lenny version?) of
/usr/share/doc/awstats/examples/awstats.model.conf.gz

In there, there is still the DirData entry
DirData="."

Does it make sense to provide another default there?


> unfortunately I threw away the old
> cron.d file (it was still lying around in /etc/cron.d/awstats.dpkg-old,
> and I was not sure if it was the source of the problem).

dpkg-old and dpkg-dist are filename extensions that are created when
a package is upgraded and a conffile overwritten. <conffilename>.dpkg-old
is created when the user has chosen to use the newly installed one. 
<conffilename>.dpkg-dist is created when the user opted to
keep the old one; it is the version from the newer package.

If you restore /etc/cron.d/awstats.dpkg-old and leave /etc/awstats/*
stuff intact - your old config should be working.



I understand the dpkg-old, dpkg-dist extensions. I was not sure if crond would
pick /etc/cron.d/awstats.dpkg-old or if it is clever enough to skip this file.

Thanks again,
Rainer

Rainer Dorsch
Là¤rchenstr. 6
D-72135 Dettenhausen
07157-734133
email:
jabber:
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F 8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/






To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search