We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

html inside cgi-bin gets a 500 error

Medium Priority
690 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
Comment
Watch Question

Commented:
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

Author

Commented:


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
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
Does your server error log contain any messages describing the error?

Author

Commented:
[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
Commented:


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


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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 ?


ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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

Author

Commented:
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
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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

Author

Commented:
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
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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?

Author

Commented:
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>
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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?

Author

Commented:

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


Commented:

What platform are you working on?

-Tony

ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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)

Author

Commented:
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...
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
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?
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.