Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

html inside cgi-bin gets a 500 error

Posted on 1997-10-16
18
637 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
ID: 1830941
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
ID: 1830942


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
ID: 1830943
Does your server error log contain any messages describing the error?
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:mickael
ID: 1830944
[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
ID: 1830945


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
ID: 1830946
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
ID: 1830947
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
ID: 1830948
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
ID: 1830949
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
 

Author Comment

by:mickael
ID: 1830950
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
ID: 1830951
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
ID: 1830952
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
ID: 1830953
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
ID: 1830954

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
ID: 1830955

What platform are you working on?

-Tony

0
 
LVL 84

Expert Comment

by:ozo
ID: 1830956
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
ID: 1830957
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
ID: 1830958
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

791 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