* [gentoo-user] Eeek: Apache2 lost it's CGI ability
@ 2009-02-15 23:59 Kevin O'Gorman
2009-02-16 0:44 ` [gentoo-user] " Harry Putnam
2009-02-17 17:10 ` [gentoo-user] " Naga
0 siblings, 2 replies; 7+ messages in thread
From: Kevin O'Gorman @ 2009-02-15 23:59 UTC (permalink / raw
To: gentoo-user
I've got a low-use CGI script on my web server. Aside from web
crawlers, I usually see at most a few hits a week from
people who share my hobby.
I just found out it's been down for an unknown period of time because
my Apache no longer does CGI scripting.
I can't even get it to run the simplest possible C program.
In /etc/apache2/httpd.conf, I've added a single line to what I think
is the standard config -- at the end I added
#KOSMANOR: defer to ./kosmanor/hexDirs.conf
Include /etc/apache2/kosmanor/hexDirs.conf
And the CGI part of hexDirs.conf is just
ScriptAlias /hex-bin /hex/bin
<Directory /hex/bin>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
I don't get much help from the logs. The access log shows that the
request got an error code,
64.166.164.49 - - [15/Feb/2009:15:46:32 -0800] "GET /hex-bin/board
HTTP/1.1" 500 542
and all that the error log says is:
[Sun Feb 15 15:46:32 2009] [error] [client 64.166.164.49] Premature
end of script headers: board
Any idea how to debug this, or any intuitions about what I neglected to do?
--
Kevin O'Gorman, PhD
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-user] Re: Eeek: Apache2 lost it's CGI ability
2009-02-15 23:59 [gentoo-user] Eeek: Apache2 lost it's CGI ability Kevin O'Gorman
@ 2009-02-16 0:44 ` Harry Putnam
2009-02-16 1:23 ` Kevin O'Gorman
2009-02-17 17:10 ` [gentoo-user] " Naga
1 sibling, 1 reply; 7+ messages in thread
From: Harry Putnam @ 2009-02-16 0:44 UTC (permalink / raw
To: gentoo-user
"Kevin O'Gorman" <kogorman@gmail.com> writes:
> I don't get much help from the logs. The access log shows that the
> request got an error code,
> 64.166.164.49 - - [15/Feb/2009:15:46:32 -0800] "GET /hex-bin/board
> HTTP/1.1" 500 542
>
> and all that the error log says is:
> [Sun Feb 15 15:46:32 2009] [error] [client 64.166.164.49] Premature
> end of script headers: board
>
>
> Any idea how to debug this, or any intuitions about what I neglected to do?
Well a few things come to mind. Test the script by hand first.
Check the permissions are 755 or the like.
Test a very simple cgi that is known to work.
Here is a simple one... make sure it has chmod 755
------- 8< snip -------- ------- 8< snip --------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "REMOTE_ADDR = $ENV{REMOTE_ADDR}<BR> \n";
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Re: Eeek: Apache2 lost it's CGI ability
2009-02-16 0:44 ` [gentoo-user] " Harry Putnam
@ 2009-02-16 1:23 ` Kevin O'Gorman
2009-02-16 6:09 ` Kevin O'Gorman
2009-02-17 15:22 ` James
0 siblings, 2 replies; 7+ messages in thread
From: Kevin O'Gorman @ 2009-02-16 1:23 UTC (permalink / raw
To: gentoo-user
On Sun, Feb 15, 2009 at 4:44 PM, Harry Putnam <reader@newsguy.com> wrote:
> "Kevin O'Gorman" <kogorman@gmail.com> writes:
>
>> I don't get much help from the logs. The access log shows that the
>> request got an error code,
>> 64.166.164.49 - - [15/Feb/2009:15:46:32 -0800] "GET /hex-bin/board
>> HTTP/1.1" 500 542
>>
>> and all that the error log says is:
>> [Sun Feb 15 15:46:32 2009] [error] [client 64.166.164.49] Premature
>> end of script headers: board
>>
>>
>> Any idea how to debug this, or any intuitions about what I neglected to do?
>
> Well a few things come to mind. Test the script by hand first.
> Check the permissions are 755 or the like.
>
> Test a very simple cgi that is known to work.
>
> Here is a simple one... make sure it has chmod 755
> ------- 8< snip -------- ------- 8< snip --------
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
>
> print "REMOTE_ADDR = $ENV{REMOTE_ADDR}<BR> \n";
This is wonderful. Thanks. Your cgi script worked just fine. I put
it in the same directory,
called it 'cgi.perl', and made the permissions 755. It ran just fine.
So I guess apache is fine.
Having something simple that works is a great help in figuring out
what is actually broken.
I've got a meeting to go to, so I'll have to get back to it.
But this much I know:
The permissions on the failing (python) script are the same. So are
the owner and group.
The python script runs fine from the command-line, even as an "other" user.
Next thing: I'll make a python version of your program and work up from there.
--
Kevin O'Gorman, PhD
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Re: Eeek: Apache2 lost it's CGI ability
2009-02-16 1:23 ` Kevin O'Gorman
@ 2009-02-16 6:09 ` Kevin O'Gorman
2009-02-17 15:22 ` James
1 sibling, 0 replies; 7+ messages in thread
From: Kevin O'Gorman @ 2009-02-16 6:09 UTC (permalink / raw
To: gentoo-user
On Sun, Feb 15, 2009 at 5:23 PM, Kevin O'Gorman <kogorman@gmail.com> wrote:
> On Sun, Feb 15, 2009 at 4:44 PM, Harry Putnam <reader@newsguy.com> wrote:
>> "Kevin O'Gorman" <kogorman@gmail.com> writes:
>>
>>> I don't get much help from the logs. The access log shows that the
>>> request got an error code,
>>> 64.166.164.49 - - [15/Feb/2009:15:46:32 -0800] "GET /hex-bin/board
>>> HTTP/1.1" 500 542
>>>
>>> and all that the error log says is:
>>> [Sun Feb 15 15:46:32 2009] [error] [client 64.166.164.49] Premature
>>> end of script headers: board
>>>
>>>
>>> Any idea how to debug this, or any intuitions about what I neglected to do?
>>
>> Well a few things come to mind. Test the script by hand first.
>> Check the permissions are 755 or the like.
>>
>> Test a very simple cgi that is known to work.
>>
>> Here is a simple one... make sure it has chmod 755
>> ------- 8< snip -------- ------- 8< snip --------
>> #!/usr/bin/perl
>> print "Content-type: text/html\n\n";
>>
>> print "REMOTE_ADDR = $ENV{REMOTE_ADDR}<BR> \n";
>
> This is wonderful. Thanks. Your cgi script worked just fine. I put
> it in the same directory,
> called it 'cgi.perl', and made the permissions 755. It ran just fine.
> So I guess apache is fine.
>
> Having something simple that works is a great help in figuring out
> what is actually broken.
> I've got a meeting to go to, so I'll have to get back to it.
>
> But this much I know:
> The permissions on the failing (python) script are the same. So are
> the owner and group.
> The python script runs fine from the command-line, even as an "other" user.
>
> Next thing: I'll make a python version of your program and work up from there.
>
> --
> Kevin O'Gorman, PhD
>
Update: still broken, but the broken piece seems to be my use of the
gettext package,
not apache. My translated message strings are still there, but
something is erroring
out when run under apache that works okay when run from the command line.
I'll sleep on it.
--
Kevin O'Gorman, PhD
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-user] Re: Eeek: Apache2 lost it's CGI ability
2009-02-16 1:23 ` Kevin O'Gorman
2009-02-16 6:09 ` Kevin O'Gorman
@ 2009-02-17 15:22 ` James
1 sibling, 0 replies; 7+ messages in thread
From: James @ 2009-02-17 15:22 UTC (permalink / raw
To: gentoo-user
Kevin O'Gorman <kogorman <at> gmail.com> writes:
> But this much I know:
> The permissions on the failing (python) script are the same. So are
> the owner and group.
> The python script runs fine from the command-line, even as an "other" user.
Hello Kevin,
2 things. Have your run 'python-updater' since your last update
of python and such? Or you just may need to rebuild some
of the modules you use with apache? (revdep-rebuild -p).
A while back, much change with the Apache config files. Even now
some of them, related to php, python and such get modified even
with minor revision updates of Apache and related packages.
I always save out old.dated config files to remind me of what I had
set. A while back the organization of some of the apache related
config files changes. Look over them to see that you have
everything set the way it needs to be. (just a thought).
Good luck,
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Eeek: Apache2 lost it's CGI ability
2009-02-15 23:59 [gentoo-user] Eeek: Apache2 lost it's CGI ability Kevin O'Gorman
2009-02-16 0:44 ` [gentoo-user] " Harry Putnam
@ 2009-02-17 17:10 ` Naga
2009-02-18 0:11 ` Kevin O'Gorman
1 sibling, 1 reply; 7+ messages in thread
From: Naga @ 2009-02-17 17:10 UTC (permalink / raw
To: gentoo-user
On Monday 16 February 2009 00:59:41 Kevin O'Gorman wrote:
> I've got a low-use CGI script on my web server. Aside from web
> crawlers, I usually see at most a few hits a week from
> people who share my hobby.
>
> I just found out it's been down for an unknown period of time because
> my Apache no longer does CGI scripting.
> I can't even get it to run the simplest possible C program.
Not sure if this is related to your problem but I had a similar issue that was
caused by having "threads" as a USE flag for Apache. This has the effect that
the mod_cgi.so module isn't built, but the mod_cgid.so one is.
/Regards
Naga
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Eeek: Apache2 lost it's CGI ability
2009-02-17 17:10 ` [gentoo-user] " Naga
@ 2009-02-18 0:11 ` Kevin O'Gorman
0 siblings, 0 replies; 7+ messages in thread
From: Kevin O'Gorman @ 2009-02-18 0:11 UTC (permalink / raw
To: gentoo-user
On Tue, Feb 17, 2009 at 9:10 AM, Naga <nagatoro@gmail.com> wrote:
> On Monday 16 February 2009 00:59:41 Kevin O'Gorman wrote:
>> I've got a low-use CGI script on my web server. Aside from web
>> crawlers, I usually see at most a few hits a week from
>> people who share my hobby.
>>
>> I just found out it's been down for an unknown period of time because
>> my Apache no longer does CGI scripting.
>> I can't even get it to run the simplest possible C program.
>
> Not sure if this is related to your problem but I had a similar issue that was
> caused by having "threads" as a USE flag for Apache. This has the effect that
> the mod_cgi.so module isn't built, but the mod_cgid.so one is.
>
> /Regards
> Naga
>
>
Problem solved. It wasn't i18n, and it wasn't Python.
Apparently somewhere along the line, apache started to provide a
command-line argument to CGI programs. At least my Python script was
getting an empty string in argv[1]. The script is picky about that,
but had old code to handle it that worked only for the command-line.
It did not expect to have any arguments at all when running as CGI.
After fixing up error handling, and training it to ignore empty string
parameters, the script runs just fine. Check it out at
http://hex.kosmanor.com/hex-bin/board if you like the game of Hex.
It's a hobby thing.
++ kevin
--
Kevin O'Gorman, PhD
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-02-18 0:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-15 23:59 [gentoo-user] Eeek: Apache2 lost it's CGI ability Kevin O'Gorman
2009-02-16 0:44 ` [gentoo-user] " Harry Putnam
2009-02-16 1:23 ` Kevin O'Gorman
2009-02-16 6:09 ` Kevin O'Gorman
2009-02-17 15:22 ` James
2009-02-17 17:10 ` [gentoo-user] " Naga
2009-02-18 0:11 ` Kevin O'Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox