Forum

Internal Server Error 500 while executing CGI

thenktor
5 September 2014, 16:44
Hiawatha version: 9.7
Operating System: Linux (Debian 4.0 ARM)

Hi,

I've compiled Hiawatha on Debian 4.0 ARM and I cannot run any CGI programs. I only see Internal Server Error 500 in the browser and in the Hiawatha error log appears:
/srv/www/htdocs/test.cgi|error while forking CGI process


The content of my test.cgi is:
#!/bin/sh
echo -e "Content-type: text/html\r"
echo -e "\r"
echo "<html>"
echo "<head>"
echo "<title>Hello Word - First CGI Program</title>"
echo "</head>"
echo "<body>"
echo "<h2>Hello Word! This is my first CGI program</h2>"
echo "</body>"
echo "</html>"


My config file is:
# GENERAL SETTINGS
#
#ServerId = www-data
ConnectionsTotal = 25
ConnectionsPerIP = 5
SystemLogfile = /tmp/h-system.log
GarbageLogfile = /tmp/h-garbage.log
PIDfile = /var/run/hiawatha.pid

# BINDING SETTINGS
# A binding is where a client can connect to.
#
Binding {
Port = 80
}

# COMMON GATEWAY INTERFACE (CGI) SETTINGS
# These settings can be used to run CGI applications.
#
CGIextension = cgi

#
# DEFAULT WEBSITE
# It is wise to use your IP address as the hostname of the default website
# and give it a blank webpage. By doing so, automated webscanners won't find
# your possible vulnerable website.
#
Hostname = 127.0.0.1
WebsiteRoot = /srv/www/htdocs
StartFile = index.html
AccessLogfile = /tmp/access-base.log
ErrorLogfile = /tmp/error-base.log
ExecuteCGI = yes


I have no problems with this config on an OpenSuse x86_64 PC and I've found similiar thread here: https://www.hiawatha-webserver.org/forum/topic/1024

Maybe there is a bug when compiled on ARM? My first thought was endianess, but both architectures are using little-endian.

Any ideas?
thenktor
5 September 2014, 16:51
Well, after trying for hours to get this working I've changed:
ConnectionsTotal = 25
ConnectionsPerIP = 5

to
ConnectionsTotal = 50
ConnectionsPerIP = 25

and now it works
This topic has been closed.