Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> CGI execution problem apache
isuck@linux
post Aug 1 2006, 05:02 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 1-August 06
Member No.: 6,883



I have little hello world cgi script that I can't get to work.
If I place the script file within a real directory within my virtual host root directory the script works just fine.
Now I read that for security reason I should place my scripts within a directory external to my virtual's host directory, so I pointed all the ScriptAlias and <directory> permissions to this new external directory and gave the user execution permissions, but now it does not work. Is it there anythning else I'm missing?

This is the configuration that does not work:

ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

<Directory "/usr/local/awstats/wwwroot/cgi-bin/">
Options +ExecCGI
AddHandler cgi-script pl cgi
AllowOverride None
Order allow,deny
Allow from all
</Directory>

If I replace this config for the following one, everything works just fine:

ScriptAlias /awstats/ "/var/www/apache2-default/www.mydomain.com/cgi-bin/"

<Directory "/var/www/apache2-default/www.mydomain.com/cgi-bin/">
Options +ExecCGI
AddHandler cgi-script pl cgi
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Permissions to the directories and scrits are set to the same. Am I missing something in httpd.conf or somewhere else that prevent my nobody apache user to execute scripts located in directories external to apache's www directory?? thanks is advance guys.
Go to the top of the page
 
+Quote Post
DS2K3
post Aug 2 2006, 02:58 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



"It doesnt workk" is unfortunately rather vague. It could mean anything from a 403 (Fobidden) to a 505 (Internal Server Error). We need more info.

If poss, also post the relevant pieces of the Apache error log (if you have once)

D


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post
isuck@linux
post Aug 2 2006, 04:35 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 1-August 06
Member No.: 6,883



QUOTE (DS2K3 @ Aug 2 2006, 01:58 PM) *
"It doesnt workk" is unfortunately rather vague. It could mean anything from a 403 (Fobidden) to a 505 (Internal Server Error). We need more info.

If poss, also post the relevant pieces of the Apache error log (if you have once)

D



Yes, apache says I have no permission to access the file. That was my question, how permissions work with CGI, do I need at least 755 in the CGI folder or I also need at least 755 in the higher folder? thanks.
Go to the top of the page
 
+Quote Post
DS2K3
post Aug 4 2006, 02:08 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,284
Joined: 14-November 04
From: Southampton, Hampshire
Member No.: 4,165



The folder must be readable and executable (which in folder terms means enter-able) by Apache itself. Generally, CGI scripts also need to be executable by Apache itself. For testing, make it 0777 (full permissions) and see if it works. If not, then it's probably Apache access rules that are stopping you.

Apache usually runs as user "nobody" or "httpd" - Try and find out which if possible since it is better not to leave things wiith full permissions.

D


--------------------
Fixed your problem? Let us know!
richard@linuxhelp.net

www.Gathr.co.uk Online Event Management
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 01:09 PM