LinuxQuestions.org
Visit Jeremy's Blog.
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 02-28-2009, 11:45 PM   #1
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Rep: Reputation: 0
Setting up Apache to view awstats from web browser


Hi all,

I just installed AWStats on a new server and can't get perl to properly work as a cgi in apache. I've done this before and got it to work, and I've tried a couple suggestions found from google with no luck.

When I try to access http://www.mysite.com/awstats/awstats.pl from my browser, Apache doesn't give any errors or anything, it just outputs the perl file in plain text, which implies that it's not handling the .pl file as a perl cgi, but I just don't know why.

Any help here would be great...it's been racking my brain for a couple of hours now. Thanks!

Here's my configuration, which pretty much sums up everything I've tried:
Code:
<VirtualHost *:80>
    DocumentRoot /webs/mysite.com/wwwroot
    ServerName mysite.com
    ServerAlias www.mysite.com
    ErrorLog /webs/mysite.com/logs/error_log
    CustomLog /webs/mysite.com/logs/access_log combined

    #Awstats
    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/"
</VirtualHost>

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options FollowSymLinks +ExecCGI
    AddHandler cgi-script .pl
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
 
Old 03-01-2009, 06:28 PM   #2
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Any ideas on this? Maybe there was a better forum for it?
 
Old 03-01-2009, 09:31 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Are you loading mod_perl in httpd.conf?
 
Old 03-01-2009, 10:46 PM   #4
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by anomie View Post
Are you loading mod_perl in httpd.conf?
D'oh. No, I didn't actually. I have it loaded now and restarted apache, but it still isn't working unfortunately.

Thanks for that though.
 
Old 03-02-2009, 12:40 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,612

Rep: Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649
what is the file permission on " awstats.pl " , is it missing a +x ?

are you running a nix distro that uses SELinux, if so what dose "SELinux Troubleshooter " say ?
 
Old 03-02-2009, 01:20 PM   #6
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Permissions are fine on awstats.pl. It shouldn't need execute permissions, but I tried chmod +x just to make sure, and still no luck.

I'm running CentOS 5 by the way.
 
Old 03-02-2009, 02:43 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
What does this command tell you?

$ /usr/sbin/getenforce
 
Old 03-02-2009, 04:49 PM   #8
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
$ /usr/sbin/getenforce
Disabled
 
Old 03-02-2009, 04:55 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by xoise
Code:
...
    ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
...
<Directory "/usr/local/awstats/wwwroot">
    Options FollowSymLinks +ExecCGI
    AddHandler cgi-script .pl
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Shouldn't that be:
Code:
<Directory "/usr/local/awstats/wwwroot/cgi-bin">
?
 
Old 03-02-2009, 06:01 PM   #10
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
I don't think that should make a difference, since cgi-bin is in wwwroot.

Either way, I tried that and still no luck.
 
Old 03-02-2009, 07:10 PM   #11
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,612

Rep: Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649
so you have ran awstats_configure.pl and set up http.conf
seeing as awstats_configure.pl ran then mod perl is working
There is no router in the mix ?

can you start it from the cli
perl awststs.pl
-- but it has been some time since i used awstats
 
Old 03-02-2009, 08:23 PM   #12
xoise
LQ Newbie
 
Registered: Dec 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Well, I'm trying to run the reports dynamically through the browser. Perl is running fine - I am able to process the logs fine and everything, it's just that when accessing the file from the internet, apache doesn't have the file run as perl, it just outputs it as text.
 
Old 03-03-2009, 01:28 AM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,612

Rep: Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649
well xoise the only thing i can suggest is to start at the beginning and see if you can find what step you missed .
something had to of been missed .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how can i view the linux documentation using web browser? tianlijian Linux - Newbie 10 11-24-2008 02:07 PM
stream media, view in web browser android6011 Linux - Software 1 01-29-2007 10:02 PM
Setting up apache logs for Awstats Help Me!!!!!!! snapper64 Linux - Software 0 01-20-2005 12:34 PM
Setting The Default Web Browser FrostBot Linux - Software 5 11-04-2004 07:55 PM
View Apache web pages r4merlin Linux - Newbie 10 02-17-2003 07:13 PM

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

All times are GMT -5. The time now is 04:05 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