lewkh Posted September 27, 2005 Share Posted September 27, 2005 Hi Folk, I am running Fedora Core3 and httpd-2.0.52-3.1. I run the following URL in my browser http://localhost/awstats/awstats.pl?config=mysite But browser return me as 500 Internal Server Error and I check my /var/log/httpd/error_log as below [Tue Sep 27 17:31:11 2005] [error] [client 127.0.0.1] (13)Permission denied: exec of '/usr/local/awstats/wwwroot/cgi-bin/awstats.pl' failed[Tue Sep 27 17:31:11 2005] [error] [client 127.0.0.1] Premature end of script headers: awstats.pl[Tue Sep 27 17:31:12 2005] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/awstats/wwwroot/cgi-bin/ my /etc/httpd/conf/httpd.conf detail as below: 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/"## This is to permit URL access to scripts/files in AWStats directory.#<Directory "/usr/local/awstats/wwwroot"> Options ExecCGI AllowOverride None Order allow,deny Allow from all</Directory> I am sure the awstats application is runable because I can generate static html file. But I do not know where I have done wrongly. Please advise what is the problem here? Thanks Quote Link to comment Share on other sites More sharing options...
Peachy Posted September 27, 2005 Share Posted September 27, 2005 Check your Perl script for syntax errors. The error message suggests that to me. Also, double-check the permissions on the script file itself. Make sure it is executable by the Apache system user. Quote Link to comment Share on other sites More sharing options...
lewkh Posted September 29, 2005 Author Share Posted September 29, 2005 Check your Perl script for syntax errors. The error message suggests that to me. Also, double-check the permissions on the script file itself. Make sure it is executable by the Apache system user.The permissions on the script file itself (awstat.pl) is -rwxr-xr-x 1 root root 527395 Feb 26 2005 awstats.pl I have checked the apache folder, as such /var/www, which is 755 and root.root for html directory. I would like to know whether apache is running by root or user apache? I check ps axu|grep httpd is running as apache user but I start the deamon and all directories related to httpd is owned by root.root. How come like tis?Let say I change to apache user to my perl script. Then I should start changing from /usr/local/awstats only or /usr?Please advise... Quote Link to comment Share on other sites More sharing options...
Bruno Posted September 29, 2005 Share Posted September 29, 2005 Let say I change to apache user to my perl script. Then I should start changing from /usr/local/awstats only or /usr?Are you sure there is an "apache user" ? Please check "cat /etc/group" Bruno Quote Link to comment Share on other sites More sharing options...
lewkh Posted September 29, 2005 Author Share Posted September 29, 2005 Are you sure there is an "apache user" ? Please check "cat /etc/group" BrunoI run ps aux|grep httpd is showing apache and cat /etc/group |grep apache as belowapache:x:48: But I try to change own to apache of my perl script then it still got the 500 Internal Server Error. I wonder wether is the problem of documentroot path /var/www/html so I setup a virtual host for it with documentroot path /usr/local/awstats/wwwroot/ then I browse the http://localhost/ it perfectly show me the 4 directories I have inside the /usr/local/awstats/wwwroot/ but once I click on one of them, it show Forbidden in browser. I really do not know what is wrong here? please advise... Quote Link to comment Share on other sites More sharing options...
linuxdude32 Posted September 29, 2005 Share Posted September 29, 2005 Apache's parent process runs as root but it doesn't do any of the serving of pages, it just calls up child processes that run as the apache user. At least that's how I understand it. Not sure if that helps you any though. Quote Link to comment Share on other sites More sharing options...
lewkh Posted September 29, 2005 Author Share Posted September 29, 2005 Hi All, I am very frustrated on the permission denied exec of /usr/local/awstats/wwwroot/awstats.pl I have tried a lot of the possible solution, as such change ownership, modify httpd.conf but I still get 403 Forbidden page on my browser. Quote Link to comment Share on other sites More sharing options...
linuxdude32 Posted September 29, 2005 Share Posted September 29, 2005 Hi All, I am very frustrated on the permission denied exec of /usr/local/awstats/wwwroot/awstats.pl I have tried a lot of the possible solution, as such change ownership, modify httpd.conf but I still get 403 Forbidden page on my browser.I just noticed something. Doesn't the perl script have to be in a cgi-bin directory for apache to execute it?Thinking maybe this page might help you in troubleshooting in any case. Let us know what was wrong if you can figure it out.http://perl.about.com/od/debuggingandsecur...l/aa080901a.htm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.