LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
LinkBack Search this Thread
Old 12-22-2004, 12:08 AM   #1
john_d13
Member
 
Registered: Apr 2004
Posts: 34

Rep: Reputation: 15
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 ?
 
Old 12-22-2004, 01:58 AM   #2
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 332

Rep: Reputation: 39
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:
Code:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
This way all files in there get interpreted.

Good luck

Last edited by rhoekstra; 12-22-2004 at 02:00 AM.
 
Old 12-22-2004, 10:31 AM   #3
john_d13
Member
 
Registered: Apr 2004
Posts: 34

Original Poster
Rep: Reputation: 15
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?
 
Old 12-22-2004, 02:05 PM   #4
rhoekstra
Member
 
Registered: Aug 2004
Location: The Netherlands
Distribution: RedHat 2, 3, 4, 5, Fedora, SuSE, Gentoo
Posts: 332

Rep: Reputation: 39
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:
Code:
<VirtualHost ....>
  DocumentRoot /var/www/site1/html 
  Scriptalias /cgi-bin/ "/var/www/site1/cgi-bin/"
</VirtualHost>
Or: (notice the cgi-bin within the DocumentRoot. Not preferred, but easier for ftp perhaps, I've seen this)
Code:
<VirtualHost ....>
  DocumentRoot /var/www/site1 
  Scriptalias /cgi-bin/ "/var/www/site1/cgi-bin"
</VirtualHost>
or another way of doing:
Code:
<VirtualHost ....>
  DocumentRoot /var/www/site1/html
  Alias /cgi-bin/ "/var/www/site1/cgi-bin/"
  <Directory "/var/www/site1/cgi-bin">
    Options +ExecCGI
  </Directory>
</VirtualHost>
Just to name a few options.

Good luck..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI File Not Executing on Apache Server kaplan71 Linux - Software 2 10-21-2004 07:12 AM
Executing from cgi theonebeyond Programming 4 10-04-2004 11:30 PM
Executing scripts upon login jungatheart Linux - Newbie 3 04-19-2004 06:06 PM
apache displays .cgi file instead of executing it hewsonism Linux - Software 2 01-13-2004 09:12 PM
Executing a program on server using CGi/PERl ?! avios Red Hat 1 12-29-2003 02:34 AM


All times are GMT -5. The time now is 03:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration