Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
<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.
Does userid "nobody" have read and execute permissions on all directories down the path to your new script directory? (Not just the final directory "cgi-bin", but each directory further up the PATH from that as well.)
What does Apache's error log tell you when you try to execute things from your new script directory? Possible location of this logfile (may be different on your system): /var/log/apache2/error.log
Tells me that I have no permission to execute. But no, I just gave X permission to the current cgi-directory, I did not gave X permission to the whole path. Then if I want to execute isuck.pl located in /usr/awstats/cgi, I need X permissions for the apache user in /cgi and also in /awstats? Isn't enough to give X permisssions in /usr/awstats/cgi? Thanks for your help.
I just gave X permission to the current cgi-directory, I did not gave X permission to the whole path.
This would be a problem. You need to be able to read (optional) and execute ALL directories in the chain down to your executable cgi file. Technically, only execute is required on the path directories. Read on directories usually runs lock-step with execute, but it doesn't have to. There may be some minor security gain in some situations to allow execute but not read on directories. This is standard Unix/Linux permission stuff - nothing special here in regards to Apache.
Yes, it is duplicated, happened that I got no answer to my post from yesterday and I found another one discussing the same issue posted today. Sorry about that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.