Jump to content

[Solved] CGI / Perl


Abonae

Recommended Posts

Hi

 

my file is in abonae.heliohost.org cgi-bin/helloworld.cgi

 

The permissions are 755 and the content of the file is:

#!/usr/bin/perl -w

use CGI qw(:standard);

print header;

 

print <<EOF;

<html>

<head>

<title>hello, world</title>

</head>

<body>

<h1>hello world</h1>

</body>

</html>

EOF

 

(I copied this from a post in this forum)

I get a 500 error every time point my browser at the above file. I've looked at the errorlog and I see:

 

[sun Jul 03 02:41:22 2011] [error] [client 78.149.9.14] (12)Cannot allocate memory: couldn't spawn child process: /home/abonae/public_html/cgi-bin/helloworld.cgi

 

 

What do I need to do?

 

Thanks

Abo

Link to comment
Share on other sites

Guest Geoff

The error I'm getting is:

 

Can't find string terminator "EOF" anywhere before EOF at ./helloworld.cgi line 5.

Link to comment
Share on other sites

Yeah, I think it's an issue with the user's code. I created a simpler hello world in the same directory and it works: http://abonae.heliohost.org/cgi-bin/test.cgi.

 

I don't know Perl, so I'm not sure what's wrong. The user's code:

#!/usr/bin/perl -w
use CGI qw(:standard);
print header;

print <<EOF;
<html>
<head>
<title>hello, world</title>
</head>
<body>
<h1>hello world</h1>
</body>
</html>
EOF

Link to comment
Share on other sites

Thanks for fixing this. I think the code was ok - helloworld.cgi works just fine now and I did not change it.

 

Can I just check something? - heliohost does not allow telnet access - is that correct? I'd like to be able to test my scripts on the server as well as via the web.

 

Thanks

 

Abo

Link to comment
Share on other sites

Guest Geoff
Can I just check something? - heliohost does not allow telnet access - is that correct?

 

We have plans to allow ssh access to johnny in the future, but from the way things are looking now, that's not going to happen for quite a while. We need to do some security audits first, to prevent something like this from happening again.

Link to comment
Share on other sites

Telnet is just a TCP/IP connection over plaintext. We "offer" Telnet for SMTP, as an example... since that protocol is TCP/IP over plaintext. But we block remote access to non-standard ports through our firewall, so you won't be able to Telnet to a service you're running on some port.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...