LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-08-2008, 08:31 AM   #1
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Rep: Reputation: 15
Exclamation cgi-bin program


Hi Friends,

I need help to make a script in cgi-bin, which will run my script on the linux server through webpage.

It's urget!!

Need your help to resolve the issue.

Thanks-
 
Old 12-08-2008, 08:45 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
So what do you need help with? You haven't posted any code people could look at. If you're requesting people to write one for you instead then maybe think about politely asking?
 
Old 12-08-2008, 10:06 PM   #3
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
I am new abt cgi-bin, I don't have idea abt this but I have to write a script using cgi-bin and when will open through webpage on linux system the other script link will be on the page. On clicking on the link the script will run on the system.

So I have to point the path in the script.

So could you please help to get this resolve?

Thanking you!!
 
Old 12-08-2008, 10:13 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
CGI is an Interface Specification, not a language. Which lang are you going to use?
Also, which distro/ver of Linux?
 
Old 12-08-2008, 11:44 PM   #5
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
When is your homework due?
 
Old 12-09-2008, 02:07 AM   #6
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
Using cgi-bin perl and distro is Redhat9 and I have to complete in a week.

Your help is more important for me!!
Thanks-
 
Old 12-09-2008, 02:43 AM   #7
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
You have to realize no one can help you with what you provided!
CGI is an interface that defines how the script gets parameters, cookies… (environment and stdin) and how the result is expected to be sent back (stdout).

The way you'll get the input values and send the output depends on the language.
Setting the language aside, the script itself depends on what functionnal result you want to achieve.

The location of the script depends on the configuration of the server you use (Apache, Mathopd…).

Your turn now…

Yves.
 
Old 12-09-2008, 08:26 AM   #8
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
I have to use cgi-bin and perl to write a script and that will call through apache.
I have to mention path of the script(shell/perl) that will run on the system by clicking the url on the webpage and the script will run on the system itself.

The example is below but I could not complete the task..



#!/usr/local/bin/perl -w
use strict;
use CGI ':standard';
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
print "Content-type: text/html\n\n";
print "<a href=<script name>name_of_the_link</a>"
...
..
.
 
Old 12-09-2008, 09:05 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Okay... now we are getting somewhere.

I suggest that you surf over to http://www.perlmonks.org and have a look around. Also, do a Google search on "perl cgi example."

And... "Don't Panic!"(tm) A week is plenty of time.

The first thing that you want to study is exactly how you go about configuring Apache to recognize that, when a request comes in to "this virtual-host," what it's supposed to do is ... not to "find a file and send its contents back," but rather "to run this-or-that program." Once again, Google is the best research-library known to mankind, and what you're looking for is "not new, just new to you!"

Then, copy some example somewhere ... how about a "For Dummies" guide at your local bookstore? Get some Perl program running. When you've got that proverbial "Hello, World!" example running, you're 99% of the way to your destination.

I mean this: "Don't Panic!" Panic is real, but it will only get in your way. "Knowledge Is Power." When your mind is caught up in "fight or flight," you're a deer in the headlights. "First, get out of the road."

Consider what happens when you are at this web-site. The Apache server that runs linuxquestions.org isn't delivering static-file contents to you: it's running a PHP program. (The program that it's running right now for me is named newreply.php.) The program that you will be running is in Perl, but the end result is the same: when I click "Submit Reply," that program will run, and it will do something with a database someplace, and it will generate HTML code as output ... which I will subsequently see.

Once again: this is not "new," it is just "new to you."

S-T-O-P and T-H-I-N-K. Push your panic aside: you need information, so S-T-O-P and R-E-A-D. You need a plan. You need to S-T-O-P until you have one.

It's called L-E-A-R-N-I-N-G. We've all been where you are, both in and out of school.

Last edited by sundialsvcs; 12-09-2008 at 09:06 AM.
 
Old 12-10-2008, 09:25 AM   #10
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
Thanks all of you for the moral and guiding support.

I have consulted the perl-black book and today able to solve 70% of my script and its working perfectly.

Actually previously I have not worked on cgi-bin/perl so I was upsate due to time bounding.

Currently I am pursuing RHCSS exam and due to lack of time, some panic side was there.
Now I am good to go ahead !!!
Again thanks for the support.



Shankar
 
  


Reply



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
c program cant run in www/cgi-bin g-mey Linux - Software 1 09-05-2006 02:46 AM
Start program in daemon mode from cgi-bin Xa! Programming 1 11-30-2004 11:00 PM
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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