LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2010, 08:12 PM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
Permission denied Awstats


HI all

Trying to install awstats by following this link
http://ubuntuforums.org/showpost.php...16&postcount=7

I get Permission denied when running the command

Code:
./awstats_configure.pl
It's been some time since I've install and have had awstats running say at lest 3 years

can some tell me why the error, or am i running the command wrong

system is Ubuntu 9.10, do you know of a better tutorial for installing awstats

TT ( karl )

Last edited by tommytomato; 03-21-2010 at 03:33 AM.
 
Old 03-20-2010, 09:06 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
From the link you gave:
Quote:
# apt-get install awstats
# cp /usr/share/doc/awstats/examples /usr/local/awstats
# cd usr/local/awstats
# mkdir wwwroot
# mkdir wwwroot/cgi-bin
# gunzip awstats.model.conf.gz
# mv awstats.model.conf wwwroot/cgi-bin
# ./awstats_configure.pl
All of the commands above are run as root user. That may be why you are getting the permission denied error.
 
Old 03-20-2010, 09:48 PM   #3
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
Run those commands using "su" or you can use "sudo"
 
Old 03-20-2010, 09:57 PM   #4
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
This may have already been checked but is the executable bit set on the file?

Regards,

Alunduil
 
Old 03-21-2010, 12:43 AM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by alunduil View Post
This may have already been checked but is the executable bit set on the file?

Regards,

Alunduil
As in permissions ?

TT ( karl )
 
Old 03-21-2010, 01:04 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by tommytomato View Post
As in permissions ?
As in "chmod +x ./awstats_configure.pl".

Evo2.
 
Old 03-21-2010, 01:27 AM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by raju.mopidevi View Post
Run those commands using "su" or you can use "sudo"
running as sudo now

1st message i was is

Code:
sudo cp /usr/share/doc/awstats/examples /usr/local/awstats
cp: omitting directory `/usr/share/doc/awstats/examples'
do i use
Code:
cp -r
instead

TT ( karl )
 
Old 03-21-2010, 01:41 AM   #8
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
I got past that, but I'm stuck on this one

Code:
/usr/local/awstats$ sudo chown -R --dereference www-data:www-data wwwroot
chown: -R --dereference requires either -H or -L
TT ( karl )
 
Old 03-21-2010, 01:55 AM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
The --dereference is applied by default according to the man page on my system. Please read the relevant part of the chown man page on your machine. You will either have to use the -H or -L flags or just omit --dereference.

Evo2.
 
Old 03-21-2010, 02:04 AM   #10
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by evo2 View Post
The --dereference is applied by default according to the man page on my system. Please read the relevant part of the chown man page on your machine. You will either have to use the -H or -L flags or just omit --dereference.

Evo2.
Quote:
Options

-H
If the -R option is specified, symbolic links on the command line are followed. Symbolic links encountered in the tree traversal are not followed.
-L
If the -R option is specified, both symbolic links on the command line and symbolic links encountered in the tree traversal are followed.
-P
If the -R option is specified, no symbolic links are followed.
-R
If file designates a directory, chown recursively changes the owner and group of each file in the entire subtree connected at that point.
-h
Change the owner and group of a symbolic link instead of the file pointed to by the symbolic link.
Are u saying to leave out the -R all together

TT ( karl )
 
Old 03-21-2010, 02:20 AM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by tommytomato View Post
Are u saying to leave out the -R all together?
I never said anything about -R.

EDIT: You need to add either -H or -L as the error message says.

Evo2.

Last edited by evo2; 03-21-2010 at 02:22 AM.
 
Old 03-21-2010, 02:23 AM   #12
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
I got it ok, just need to run the update fuction now to bring up the images in the graphics, me thinks

I'll post back later my command line as a ref for other, I have not as yet clear the cli

TT ( karl )
 
Old 03-21-2010, 02:50 AM   #13
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
when running this command

Code:
sudo /usr/lib/cgi-bin/awstats.pl -config=mysite.com -update
I get this message

Code:
Error: Couldn't open server log file "/var/log/httpd/mylog.log"
that file is not there, is it looking for the apache2 access.log file

TT ( karl )
 
Old 03-21-2010, 03:44 AM   #14
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Here's what I've done, still unsure about the icons and the classes folder.

any one care to fill me in to some fixes, the awstats is running

Code:
tommytomato@localhost:~$ sudo apt-get install awstats
Quote:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libnet-dns-perl libnet-ip-perl libgeo-ipfree-perl
The following NEW packages will be installed:
awstats
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 951kB of archives.
After this operation, 5,214kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com karmic/main awstats 6.9~dfsg-1ubuntu3 [951kB]
Fetched 951kB in 20s (47.0kB/s)
Selecting previously deselected package awstats.
(Reading database ... 67895 files and directories currently installed.)
Unpacking awstats (from .../awstats_6.9~dfsg-1ubuntu3_all.deb) ...
Setting up awstats (6.9~dfsg-1ubuntu3) ...
Run as sudo not root

Code:
tommytomato@localhost:~$ sudo cp -R /usr/share/doc/awstats/examples /usr/local/awstats
Code:
tommytomato@localhost:~$ cd /usr/local/awstats
Code:
tommytomato@localhost:/usr/local/awstats$ sudo mkdir wwwroot
Code:
tommytomato@localhost:/usr/local/awstats$ sudo mkdir wwwroot/cgi-bin
Code:
tommytomato@localhost:/usr/local/awstats$ sudo gunzip awstats.model.conf.gz
Code:
tommytomato@localhost:/usr/local/awstats$ sudo mv awstats.model.conf wwwroot/cgi-bin
Now run the awstats configue file to update your records

Code:
tommytomato@localhost:/usr/local/awstats$ sudo ./awstats_configure.pl
Quote:
----- AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install

Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
Code:
> /etc/apache2/apache2.conf
Quote:
-----> Check and complete web server config file '/etc/apache2/apache2.conf'
Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
Add '<Directory>' directive
AWStats directives added to Apache config file.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> localhost.com

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.localhost.com.conf'
Config file /etc/awstats/awstats.localhost.com.conf created.

-----> Restart Web server with '/etc/init.d/apache restart'

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=localhost.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...


A SIMPLE config file has been created: /etc/awstats/awstats.localhost.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'localhost.com' with command:
> perl awstats.pl -update -config=localhost.com
You can also read your statistics for 'localhost.com' with URL:
> http://localhost/awstats/awstats.pl?...=localhost.com

Press ENTER to finish...
Code:
tommytomato@localhost:/usr/local/awstats$ sudo ln -s /usr/local/awstats/css/ wwwroot
Code:
tommytomato@localhost:/usr/local/awstats$ sudo ln -s /usr/local/awstats/css/* wwwroot/
Code:
tommytomato@localhost:/usr/local/awstats$ sudo ln -s /usr/lib/cgi-bin/awstats.pl wwwroot/cgi-bin/
Code:
tommytomato@localhost:/usr/local/awstats$ sudo chown -R www-data:www-data wwwroot
Code:
tommytomato@localhost:/usr/local/awstats$ sudo chown -R www-data:www-data /var/lib/awstats
Code:
tommytomato@localhost:/usr/local/awstats$ sudo chown root:www-data /var/log/apache2/access.log
Now edit the apache2 file /etc/apache2/apache2.conf

Code:
tommytomato@localhost:/usr/local/awstats$ sudo vim /etc/apache2/apache2.conf
<Directory "/usr/loacl/awstats/wwwroot">, and put a # in front of the line "Options None" it should look like:

Code:
<Directory "/usr/local/awstats/wwwroot">
# Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Code:
tommytomato@localhost:/usr/local/awstats$ sudo /etc/init.d/apache2 reload
Quote:
* Reloading web server config apache2 [ OK ]

Next Step
Code:
sudo /usr/lib/cgi-bin/awstats.pl -config=localhost.com -update
or

Code:
sudo perl /usr/local/awstats/awstats_updateall.pl now

You may get an error about the log file, you need to edit the file

Quote:
/etc/awstats/awstats.localhost.com.conf
Code:
sudo vim /etc/awstats/awstats.localhost.com.conf
change the file like so

Quote:
#LogFile="/var/log/httpd/mylog.log"
LogFile="/var/log/apache2/access.log"
Then run this command to update records
Code:
sudo /usr/local/awstats$ sudo /usr/lib/cgi-bin/awstats.pl -config=localhost.com -update

Quote:
Create/Update database for config "/etc/awstats/awstats.localhost.com.conf" by AWStats version 6.9 (build 1.925)
From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 4249
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 4249 new qualified records.
tommytomato@localhost:/usr/local/awstats$
My icons were not showing either so i had to copy the folder icons
from /usr/share/awstats to /usr/local/awstats/wwwroot/icon/

below is a sample of the paths apache2 needs for them to show
I also had to chmod to 0777 for them to show.
Code:
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
I wasn't to find "/usr/local/awstats/wwwroot/classes/" not on my system

want to remove the update link on your awstats page, you need to edit the awstats.localhost.com.conf file

/etc/awstats/awstats.localhost.com.conf

Code:
sudo vim /etc/awstats/awstats.localhost.com.conf
set the below to 0, if you want to be able to update via the browser set to 1

Code:
AllowToUpdateStatsFromBrowser=0
Hows that sounds guys

I'll do the cron job next

TT ( karl )
 
Old 03-21-2010, 07:56 AM   #15
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Bring up the crontab to see what you have
Code:
sudo crontab -l
Quote:
tommytomato@localhost:~$ sudo crontab -l
24 0 * * * /etc/webmin/cron/tempdelete.pl #Delete Webmin temporary files
10 * * * * /usr/lib/cgi-bin/awstats.pl -config=localhost.com -update
to edit crontab use the -e command

Code:
sudo crontab -e
now place in the cron
Code:
10 * * * * /usr/lib/cgi-bin/awstats.pl -config=localhost.com -update
Hope this work, have to wait an hour to see what happens

TT ( karl )
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission Denied bazutti Linux - Newbie 2 10-16-2009 03:19 PM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM
Permission Denied lackof Linux - Networking 1 08-14-2002 10:46 PM
Permission Denied Viper Slackware 7 08-07-2002 08:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration