ID:135296
 
Grei and I are currently working on setting up DMCGI for his server so that planetBYOND may come back. We're running into some troubles, however.

http://www.knifehits.com/temp/HelloDMCGI.dmb CGI authentication set to 1
http://www.knifehits.com/temp/HelloDMCGI2.dmb CGI authentication set to 0

I'm getting an Internal Server Error. The log returns "[Fri Oct 22 14:44:55 2004] [error] [client 66.176.125.246] Premature end of script headers: HelloDMCGI.dmb"

Following Mike's advice in [link] the program he suggested returns:

SERVER_SIGNATURE=Apache/2.0.48 (Fedora) Server at www.knifehits.com Port 80

UNIQUE_ID=OTxKj38AAAEAABYyeQkAAAAF
HTTP_KEEP_ALIVE=300
HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
SERVER_PORT=80
HTTP_HOST=www.knifehits.com
DOCUMENT_ROOT=/var/www/knifehits
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
SCRIPT_FILENAME=/var/www/knifehits/temp/env.cgi
REQUEST_URI=/temp/env.cgi
SCRIPT_NAME=/temp/env.cgi
HTTP_CONNECTION=keep-alive
REMOTE_PORT=3555
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PWD=/var/www/knifehits/temp
SERVER_ADMIN=webmaster@knifehits.com
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
HTTP_ACCEPT=application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
REMOTE_ADDR=66.176.125.246
SHLVL=1
SERVER_NAME=www.knifehits.com
SERVER_SOFTWARE=Apache/2.0.48 (Fedora)
QUERY_STRING=
SERVER_ADDR=207.36.229.2
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
HTTP_ACCEPT_ENCODING=gzip,deflate
REQUEST_METHOD=GET
_=/bin/env


The DMB extension has been added to AdHandler. BYOND world's run fine with the same path and BYOND is installed globally. Any ideas for how to fix this?
Have you changed one of the apache file's to phrase .dmb extensions?
First, make sure your dmb file is executable (chmod 755 HelloDMCGI.dmb).

Second, it's quite possible that the server isn't recognizing .dmb as a valid CGI script extension. There are two ways around this; either method will work. First is to rename the file to have a .cgi extension (in CGI mode, there's no requirement to have a .dmb extension). The other method is to configure the server to accept .dmb as a valid script extension. To do this, you need a line like
AddHandler cgi-script .dmb

either in a file called .htaccess in the directory containing your dmb files, or in the httpd.conf.
In response to Mike H
As I mentioned, I have that line in AddHandler. Upon reuploading, HelloDMCGI2.dmb (no authentication) works fine, while the other still doesn't. I imagine it has to do with byondcert.
In response to HavenMaster
I suspect the problem is that whatever userid actually runs the script doesn't have permission to create a .byond/ directory under its home. You might try the sample code in id:282125 and see if it helps shed any light.

Edit: Though I notice in your env output, there is no HOME variable. That complicates things a bit. BYOND does grab the correct home directory in this case, but it's not available within DM. This makes it a little tougher to diagnose.
In response to Mike H
On shell, type

"mkdir /.byond"

This should create a .byond directory. Then type mkdir "/.byond/cfg". Then type "chmod 777 /.byond" and "chmod 777 /.byond/cfg". That worked for me. I think. I forgot. Servers down. In fact the box was disassembled. Crap.

[Edit]
Ohh. His userid doesn't have access to do that. Misread.

Login to root first. Then go do that. When you did that, it should work, because your userid will have access to read/write to the directory (as everybody on the system can with chmod 777..).
[/Edit]