-   Linux - General (
-   -   CGI Scripts not executing, pls help (

john_d13 12-22-2004 01:08 AM

CGI Scripts not executing, pls help
I am running a basic login script with username and password, really text book, ive done this so many times, but now when I execute the script its like there is no interpreter and all I get is text of the actual script. The first line reads #!/usr/bin/perl which is where perl is installed by default cause im using RedHat 9.

Can anone help ?

rhoekstra 12-22-2004 02:58 AM

Is the script placed in the cgi-bin folder? Does Apache understand to do +ExecCgi on that folder?

Or, as with Fedora Core 3, I have this line:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
This way all files in there get interpreted.

Good luck

john_d13 12-22-2004 11:31 AM

hmmm maybee thats the prob, im guessing thats in httpd.conf.

If that is the case, say im running 3 sites each with different virtual hosts and for each site i have different folders in /var/www/site1, or /var/www/site1, that means I will have different /cgi folders for each site. I guess I just have to add the script alias line in each virtual host right?

rhoekstra 12-22-2004 03:05 PM

Yes, sorry, I was talking about /etc/httpd/conf/httpd.conf indeed.

You could do the above line for each virtual site indeed..

like, per site:

<VirtualHost ....>
  DocumentRoot /var/www/site1/html
  Scriptalias /cgi-bin/ "/var/www/site1/cgi-bin/"

Or: (notice the cgi-bin within the DocumentRoot. Not preferred, but easier for ftp perhaps, I've seen this)

<VirtualHost ....>
  DocumentRoot /var/www/site1
  Scriptalias /cgi-bin/ "/var/www/site1/cgi-bin"

or another way of doing:

<VirtualHost ....>
  DocumentRoot /var/www/site1/html
  Alias /cgi-bin/ "/var/www/site1/cgi-bin/"
  <Directory "/var/www/site1/cgi-bin">
    Options +ExecCGI

Just to name a few options.

Good luck..

All times are GMT -5. The time now is 10:08 AM.