LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2004, 01:05 AM   #1
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Rep: Reputation: 16
CGI not working in Apache


Hi to all,

I am trying to Install LXR (Linux Cross Refrencing tool). I was easy, untill the time I got stuck at run it.

As per the requirements of LXR, I can open the default page [blurb.html] from the web browser on my system. But there is a CGI script [that is what the documentation says] that is supposed to be executed by Apache as CGI script. It infact reads that script as a file and prints it on screen.

I tried excuting it by ./<the script> and it gave a HTML file as output, so that means the script is fine. I could have used this file, but there are many more scripts that have to be executed as CGI.

THese are the things that I tried:
1. kept the code in cgi-script folder of the www, NOT wroking
2. I changed the httpd.conf file to allow execution of CGI scripts in directories besides CGI using the Apache TOMCAT manual: NOT WORKING YET
3. I added a file .htaccess in the directory having the LXR code for access permissions, as per what the LXR documentation says: Still NOT WORKING.
4. NO MORE I AM EXHAUTSED...

ANy body who has done any related kind of work, please do help me.

Thanks a lot,
Shrey
 
Old 09-20-2004, 05:11 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
The directory must contain ExecCGI option and apache must recognise the file as cgi-script.

See apache cgi tutorial for details.
 
Old 09-20-2004, 05:14 PM   #3
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
A test script:
Code:
#!/usr/bin/perl

use strict;

print "Content-type: text/html\n\n";
print "Hello, world!...";
If you drop this to some location and access that with web browser, you should get a string
"Hello, world!.." in your browser if you have configured your cgi hooks correctly.
 
Old 09-21-2004, 12:11 AM   #4
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Original Poster
Rep: Reputation: 16
Thanks ToniT,

I will try that out, and if successful will mail back here.
 
Old 09-22-2004, 12:28 AM   #5
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Original Poster
Rep: Reputation: 16
Hi ToniT,

Thanks a lot, I ws able to make the server execute the files as CGI, I has missed out a point specified in the Apache DOC previously.

Thanks a ton.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi with apache ApacheMan252 Linux - Software 27 02-26-2003 07:41 PM
apache v2.0.44 + cgi ; securing cgi-support in apache markus1982 Linux - General 0 01-20-2003 01:03 PM
About cgi , pl. in apache.... raymond Linux - General 1 11-11-2002 09:22 AM
CGI Apache rsitmsw Linux - Networking 1 05-07-2002 04:05 PM
CGI Apache rsitmsw Linux - General 1 05-07-2002 04:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration