simple cgi script not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting simple cgi script not working
# 1  
Old 06-28-2009
Error simple cgi script not working

hi all,

i have installed simple cgi-script
under apache/cgi-bin directory

hello.cgi

Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML

when i hit the url http://hostnameSmilieortno/cgi-bin/hello.cgi
i get the error as 503 Service Temporarily Unavailable

when i check the apache error log:
I see the below error messages:

[Sun Jun 28 01:08:12 2009] [error] [client xx.xx.xxx.xxx] (2)No such file or directory: unable to connect to cgi daemon after multiple tries:hostnameSmilieortno/cgi-bin/hello.cgi

Any help is greatly appreciated!!!

Last edited by Yogesh Sawant; 06-28-2009 at 04:45 AM.. Reason: added code tags
# 2  
Old 06-28-2009
Put this line in the script

use CGI;
# 3  
Old 06-28-2009
PHP

Hi Igor,

I have put use CGi; in my script
but still i'm getting same error:

In the logs, I see same error message:
[Sun Jun 28 09:02:06 2009] [error] [client xx.xx.xxx.xxx] (2)No such file or directory: unable to connect to cgi daemon after multiple tries: /hostname/apache/cgi-bin/hello.cgi
# 4  
Old 06-28-2009
Including the CGI module won't do any difference, as it's only purpose is to simplify CGI programming (Parameter usage, HTML output, ...)

What are the permissions on hello.cgi? What are the lines for the CGI handlers in Apaches configuration files?
# 5  
Old 06-28-2009
raghur77,

Ask your hosting service what the problem is.
# 6  
Old 06-29-2009
Then you have put the script in a wrong directory or the handler for that directory has not been sat properly for cgi-script. Who ever is the admin on the box should fix this and tell you what do. If it's ISP call them and tell them about the problem.
# 7  
Old 06-30-2009
MySQL

I recycled apache webserver and the problem is resolved. not sure what went wrong here.
Now all set.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple sftp script not working - Please help

I have the below sftp script to transfer a file from a linux host(source) to another linux host(target). Public key is already set up in target host and I am able to transfer file using sftp from source to target. But not sure why the below script(ftp_script) is not working. Any help in this... (3 Replies)
Discussion started by: Armaan
3 Replies

2. Shell Programming and Scripting

[Solved] Simple script not working- for loop

Hi all, Please guide me writing this script Follwing is the file which I have created, which contains the files to be copied. cat system1-dr.txt /etc/passwd /etc/shadow /etc/group /etc/vfstab /etc/profile /etc/default/init /etc/shells /etc/dfs/dfstab /etc/dfs/sharetab... (11 Replies)
Discussion started by: manalisharmabe
11 Replies

3. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

4. Web Development

perl cgi script not working

Hello, Met a problem learning perl cgi script. 1 #!/usr/bin/perl -wT 2 3 use strict; 4 use CGI qw(:standard); 5 6 my $q = new CGI; 7 8 my $filename = $q->param('/home/yifangt/hello.cgi'); 9 my $contenttype = $q->uploadInfo($filename)->{'Content-Type'}; 10... (5 Replies)
Discussion started by: yifangt
5 Replies

5. Shell Programming and Scripting

simple script to alert if internet not working?

Hi, I am constantly automaticaly downloading a few things on the internet but since my internet connection is unstable, it sometimes wont work. Thing is the internet will appear to be connected, but no website can be accessed and no program can successfully connect to any location. I can fix... (4 Replies)
Discussion started by: fuzzylogic25
4 Replies

6. Shell Programming and Scripting

Simple BASH script not working?

So I need a script that does the following: If a certain user is logged in Run `command` Else Echo “incorrect user” This is my first stab...which doesn't work: #!/bin/bash X="user=`ls -l /dev/console | cut -d " " -f 4`" Y="foobar" echo $X echo $Y (4 Replies)
Discussion started by: doubleminus
4 Replies

7. Shell Programming and Scripting

simple perl script not working

why won't below work? I am trying to see a)sipfile has username of the system. b)it will read the sipfile and do a grep function against the /etc/passwd c)it will save that output to /tmp/result.. but my script is just hanging... #!/usr/bin/perl -w open(SIPFILE, "</tmp/sipfile") ... (4 Replies)
Discussion started by: hankooknara
4 Replies

8. Shell Programming and Scripting

Why this simple script, is not working ?

Hi everybody I want to create 20 file using simple script - listed bellow-. But the script doesn't work. I hope anyone guide me to correct this script ---------------- The script integer number=01 until (($number==21)) do >TELE-LOG-$number number=$number+01 echo $number done exit... (4 Replies)
Discussion started by: so_friendly
4 Replies

9. Shell Programming and Scripting

CGI passing arrays/hashes to another CGI script

If I have a Perl CGI script (script01), which fills an array(s) with information and outputs a HTML page with a link to another CGI page (script02); is there anyway to pass the array(s) from "script01" to "script02" when the page visitor clicks the link? Hope that makes sense! :) (2 Replies)
Discussion started by: WIntellect
2 Replies
Login or Register to Ask a Question