Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Does anyone know how to configure the apache config file httpd.conf to allow users to execute CGI programs. What I would like is to basically allow any CGI script that is contained in any cgi-bin directory to be allowed to execute, under an address like so:
What I don't want to do is individually set-up each directory to use CGI. If this is not possible then does anyone know how to configure the conf file to set up CGI in any directory?
I will try that out. The error I keep getting is to do with Premature end of script headers. I have checked the Apache docs, but none of the advice is particularly useful. I know that I cab run CGI perl scripts, because I am able to use the script alias thing, but I really need to run CGI in the home directorys.
Premature end of script headers is usually a symptom of DOS formatted perl scripts. Use the command "dos2unix" to convert these into UNIX formatted perl scripts.
I can't see how that is true seeing as the scripts can be excuted, and the fact they were written and saved in Linux. All they do is say Hello World in Perl.
I'm pretty sure that this is an apache config problem, or something to do with the user who runs apache, who in this case is webuser.
I have the exact same problem. Did you ever find a solution, or does anyone have a solution for this? The script I am using is a very simple one that I use to test cgi permissions - runs on all my other boxes. Permissions set to 755
RH8, perl 5.x, apache 2.x
edit -
christ, I posted this on the wrong thread....I am attempting to run this script from the default /var/www/cgi-bin/ folder, not a user home directory...sorry
/edit
Last edited by huxtablejones; 12-08-2002 at 04:58 PM.
I'm not guaranteeing that this is your problem, but I found that suexec gave me fits similar to what you are describing. The easiest fix is to locate suexec, and move it to another directory, then restart apache. The reason is that (i think) suexec is compiled into the RPM with CGI running as the user has to be run from under the /var/www/cgi-bin directory. When you setup virtual servers that run from users home directories (i.e. /home/user/www/cgi-bin), seexec will not allow the script to run. You're supposed to be able to recompile suexec to use another directory, but I have never been brave enough to do it without specific directions from an advanced user. I do know that you can set Apache to run as user Apache and group Apache in the conf file, then remove suexec from the default path and Apache will run the scripts where you tell them to. I would just like to run Apache as the user instead of Apache.
Hope this helps somehow,
Mark
The problem you will find (that I previously encountered) is that when files are created by apache through the cgi, they will be owned by apache. If the user logs in via ftp, telnet, or ssh, they will not have the permissions needed to edit or delete them. By fixing suexec, apache will run as the user, and all files or directories created by cgi processes will be owned by that user. In some situations, the 755 and group change will work fine, in others, it won't.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.