Solved

html inside cgi-bin gets a 500 error

Posted on 1997-10-16
18
632 Views
Last Modified: 2013-12-20
Hello,

I am trying to run a forum and display other html pages in cgi-bin and below but I systematically get an error 500?

Can this problem been solve?

1) How

2) is security an issue

Thank you
0
Comment
Question by:mickael
  • 8
  • 7
  • 2
  • +1
18 Comments
 
LVL 3

Expert Comment

by:vmpn
Comment Utility
500 is stands for Server Error,  the server may run out of threads for running CGI. Possible Causes: a lot users use the same web server sumunteniously, your CGI do not terminate (new thread is allocated for each instance of CGI). Possible Solutions: increase number availiable threads, check if your CGI terminite fully (free memory, do not leave any resident parts)

Sincerely,
VMPN
0
 

Author Comment

by:mickael
Comment Utility


Hello,

Thanks for your reply.

I understand that the problem comes from trying and sysytematically execute programs in this directory and below.

The server is not reading but executing...

How can this be overcomed?

Thank you
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Does your server error log contain any messages describing the error?
0
 

Author Comment

by:mickael
Comment Utility
[Thu Oct  9 01:35:49 1997]
HTTPd/CGI: exec of
/usr/local/etc/httpd/htdocs/jeuxvideo/cgi-bin/wwwboard/forum.htm
failed, errno is 8
[Thu Oct  9 01:37:02 1997] HTTPd: malformed header from script
/usr/local/etc/httpd/htdocs/jeuxvideo/cgi-bin/wwwboard/forum.htm
0
 
LVL 4

Accepted Solution

by:
rembo earned 50 total points
Comment Utility


Well, it looks like your CGI is not valid.  forum.htm
is not a valid name and the errno 8 is ECHILD which
means that the Web Server couldn't start the process.

Make sure that your script is a valid executable.
You need to be able to execute it from the command
line for your Web Server to be able to start it.

-Tony


0
 

Author Comment

by:mickael
Comment Utility
Ok, however I have tried to put a simple HTML page witha line or 2 of HTML and it also tries to execute unstead of displaying ?


0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Could you put it under htdocs instead of under cgi-bin?
What path do you use in the url to open them?
Are you using anything like
ScriptAlias /cgi-bin/ /usr/local/etc/httpd/cgi-bin/
in your server configuration?  or
0
 

Author Comment

by:mickael
Comment Utility
Yes, I am using the above path for script aliases

here is the url of the script
http://www.jeuxvideo.com/cgi-bin/wwwboard/forum.htm
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Hmm, then where did the "/htdocs/jeuxvideo/" come from in the above error?

Could you just move forum.htm into /htdocs//wwwboard/ and call it with
http://www.jeuxvideo.com/wwwboard/forum.htm
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:mickael
Comment Utility
Not really, it is full of files...

/usr/local/etc/httpd/htdocs/jeuxvideo/cgi-bin/wwwboard/forum.htm

jeuxvideo is actiually a virtual hoast with its own domain name; it has a cgi-bin of its own (I think is is actually an aliase of the main cgi-bin (htdocs/cgi-bin)

and forum is a directory inside the cgi-bin where the forum html files are keept.

Voila for the layout...

when trying to read an html file in forum the server tries to execute it! thinking it is some kind of script/cgi
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Well, if you can't link it to a non ScriptAlias directory under DocumentRoot,
then how about making your .htm file executable, and adding something like
#!/usr/bin/tail +2
Content-type: text/html

...
to the beginning of it?
0
 

Author Comment

by:mickael
Comment Utility
Hi,

here is my page html, I still get a 500 error


#!/usr/bin/tail +2
Content-type: text/html
<HTML>
<HEAD>
<TITLE>testing</TITLE>
</HEAD>
<body bgcolor="#FFFFFF">



testing

<p>



</BODY>
</HTML>
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
And what does your server error log say this time?
There should have been a blank line after that  
Content-type: text/html

(but I don't think that would cause a 500 error)
Is /usr/bin/tail the right place to find it on your system?
Is it, and your file, executable by the server?
0
 

Author Comment

by:mickael
Comment Utility

Hi,

I have inserted a space but I still get a 500 type error.

here is the error_log

[Fri Oct 17 07:51:37 1997] invalid CGI ref /usr/local/etc/httpd/htdocs/jeuxvideo/cgi-bin/mess/message.plx in /usr/local/etc/httpd/htdocs/jeuxvideo/videcount.htm


Is /usr/bin/tail the right place to find it on your system?

Well, I ahve never seen the tail script/program you are refering.

I do have a user/bin with sort, seed, mai, Mail, finger, date, ccp, basename awk  and autoreply

Thanks,
Mickael


0
 
LVL 4

Expert Comment

by:rembo
Comment Utility

What platform are you working on?

-Tony

0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
try typing
which tail
or
man tail
at the command prompt, do they tell you where to find it?
(otherwise, we could insert an awk script at the beginning)
0
 

Author Comment

by:mickael
Comment Utility
Unix BSDI vs 3

When typind man tail I get some info about this command but I do not see it any where on the site...
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
does
whereis tail
do anything? or
tail /usr/local/etc/httpd/htdocs/jeuxvideo/cgi-bin/wwwboard/forum.htm
It seems unusual for a system not to have it at all, but if not, an alternative might be
#!/bin/sh
cat <<ENDHERE
Content-type: text/html
 
<HTML>
...
</HTML>
ENDHERE

no other blank space on the line with the final ENDHERE
(of course, we may then have to search for where sh is on your system)
Do your real .cgi programs have a #! line at the top?  What do they use?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now