[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache and CGI



> On Tuesday 22 June 2004 11:23 am, richard lyons wrote: > > On Tuesday 22 June 2004 08:19, Greg Sidelinger wrote: > > > Ok I feel pretty stupid for even asking this but how do I make cgi > > > scripts work with apache2 and unstable. I did just the default > > > install of apache2 and tried to run the test-cgi script and all I > got > > > for output was the script itself. I know I have had this same > > > problem before on unstable but for the life of me I can't figure > out > > > what I did to fix it. The scripts are all 755 and nothing shows up > > > in the error logs. I just got the script displaced which tells me > > > that they are not being processed. > > > The /etc/apache2/sites-enabled/default config file has ExecCGI and > a > > > scriptalias for the directory but for the life of me I can't get > > > apache to process the cgi scripts. I'm using the > apache2-mpm-prefork > > > package. The the current config is the default from the packages. > If > > > anyone can point me in the correct direction so I can test some > > > simple programs please let me know what I'm over looking. > > > > Have a look at your /etc/apache/httpd.conf -- it is pretty well > > documented. > > > > I think what you are looking for is a stanza for whichever directory > you > > want to run cgi scripts from. Make sure you still have something > like > > > > # or wherever > > AllowOverride None # I forget what this is at the mo. > > Options ExecCGI # This is the line in question > > Order allow,deny # The usual access control thing... > > Allow from all # ... or whatever > > > > > > Read the rest of it as well while you are there. It`s full of wisdom > > which I have forgotten since I last looked... (Which may also mean > I`m > > barking up the wrong tree) > > > > HT(happens to)H > > -- > > richard > > I have all that stuff in /etc/apache2/sites-enabled/default > > ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ > > AllowOverride None > Options ExecCGI -MultiViews +SymLinksIfOwnerMatch > Order allow,deny > Allow from all > > > the Alias part of the scriptalias works just fine. Just not getting > the > ExecCGI. I even tried turning on AddHandler but it did not help. > > AddHandler cgi-script .cgi .pl > > I'm really not sure what i'm doing. I'm just confused as to why the > default > config is not working, must be that unstable thing. But I know I have > had > this problem before with unstable, just can't remember what I did to > fix it. > And yes I have read the apache conf file, many times. > > Greg > Hi Greg, I had some of the same problems you are experiences and have found these solutions. For starters I write my own cgi's and just wanted to enable ExecCGI in the httpd.conf, my configs generally look like this: ServerAdmin info@abc.com DocumentRoot /var/www/abc_com/www ServerName abc.com ServerAlias www.abc.com ErrorLog /var/www/abc_com/logs/www/error.log CustomLog /var/www/abc_com/logs/www/access.log full User abc Group abc Options IncludesNOEXEC MultiViews SymLinksIfOwnerMatch AllowOverride FileInfo AuthConfig Limit Order allow,deny Allow from all Order deny,allow Deny from all AllowOverride None Options ExecCGI Order allow,deny Allow from all ScriptAlias /cgi-bin/ /var/www/abc_com/www/cgi-bin/ After restarting the network and Apache services I found that it still wasn't working right so I dug into the problem making sure I had given the cgi's the right privilages and discoved that in order for ExecCGI to work you also needed to makesure that the file in this directory was name: /usr/lib/apache/suexec and not: /usr/lib/apache/suexec.disabled After renaming this file and restarting the services my ExecCGI call started working properly. Vince
Reply to: