You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mark rostron <mr...@real.com> on 2002/02/02 01:34:38 UTC

~user/cgi_bin script config problem - approx 20k attached

httpd -v output:

Server version: Apache/1.3.19 (Unix)  (SuSE/Linux)
Server built:   May 14 2001 15:46:52

I am attempting to configure apache 1.3.19 (suse 7.2 distribution) to enable 
user cgi-bin scripting by enabling ExecCGI for directory 
/home/username/public_html/cgi-bin
But with no luck.
Attached are compressed versions of httpd.conf, together with the inclusion 
for public_html/cgi-bin execution.
I have tested the script by putting into the ScriptAlias directory 
for /cgi-bin/ and the script worked fine.

the error message in error_log is:

[Fri Feb  1 16:32:08 2002] [error] [client 127.0.0.2] Premature end of script 
headers: /home/mrostron/public_html/cgi-bin/test.cgi

The entry in access_log is:

127.0.0.2 - - [01/Feb/2002:16:32:08 -0800] "GET /~mrostron/cgi-bin/test.cgi 
HTTP/1.1" 500 606

Thanks for your time on this...
mr

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: keeping multiple httpd.conf synchronized

Posted by Mark Foster <md...@enic.cc>.
I'm not sure if this will help you or not, but here's a trick I have
used in the past. Works on unix (linux & freebsd, others I'm sure).

Let's say you have three apache headends that all have the same
httpd.conf file info, except for the IP and hostname of the box is
different for each (naturally).

For headend#1 (he1) you might have a line like this in /etc/hosts...
192.128.15.12	he1 www

For headend#2 (he2) you would have this line
192.168.15.13	he2 www

and so on. This enables you to use
<VirtualHost www> in your httpd.conf making them all identical.

On Wed, 2002-02-13 at 15:05, jon schatz wrote:
> On Wed, 2002-02-13 at 14:45, Farid Hamjavar wrote:
> > I  am asking  the  question above  based  on the  assumption
> > that the  httpd.conf for web-server-1 and  web-server-2 thru
> > web-server-N  are  %100 identical  and  differ  only in  the
> > occurrence of server name and IP#.
> 
> one way is to compile in mod_perl, and use the Perl directive. This
> example config would take the servername and ip from the current machine
> info (web-server-N):
> 
> httpd.conf:
> <--snip-->
> <Perl>
> chomp(my $hostname = `hostname`);
> my $ip = join ".", unpack('C4, gethostbyname($hostname));
> $Listen = "$ip:80";
> $ServerName = $hostname;
> </Perl>
> 
> the perl configuration directives are pretty powerful...
> 
> -jon
> 
> -- 
> jon@divisionbyzero.com || www.divisionbyzero.com
> gpg key: www.divisionbyzero.com/pubkey.asc
> think i have a virus?: www.divisionbyzero.com/pgp.html
> "You are in a twisty little maze of Sendmail rules, all confusing." 
-- 
-mdf [Mark D. Foster]                          Phone: 206-381-0449
System Administrator - eNIC Corporation          Fax: 206-329-7107
<md...@enic.cc> or mergatroid on AIM 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: keeping multiple httpd.conf synchronized

Posted by jon schatz <jo...@divisionbyzero.com>.
On Wed, 2002-02-13 at 14:45, Farid Hamjavar wrote:
> I  am asking  the  question above  based  on the  assumption
> that the  httpd.conf for web-server-1 and  web-server-2 thru
> web-server-N  are  %100 identical  and  differ  only in  the
> occurrence of server name and IP#.

one way is to compile in mod_perl, and use the Perl directive. This
example config would take the servername and ip from the current machine
info (web-server-N):

httpd.conf:
<--snip-->
<Perl>
chomp(my $hostname = `hostname`);
my $ip = join ".", unpack('C4, gethostbyname($hostname));
$Listen = "$ip:80";
$ServerName = $hostname;
</Perl>

the perl configuration directives are pretty powerful...

-jon

-- 
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing." 

keeping multiple httpd.conf synchronized

Posted by Farid Hamjavar <ha...@unm.edu>.

apache-1.3.22-2 (linux 2.4 kernel).


Greetings,

I  was wondering  what strategies  other admins  employ when
there are  multiple web-servers  running apache in  terms of
keeping the httpd.conf synchronized?

I  am asking  the  question above  based  on the  assumption
that the  httpd.conf for web-server-1 and  web-server-2 thru
web-server-N  are  %100 identical  and  differ  only in  the
occurrence of server name and IP#.


Thanks, 
Farid 
UNM-CIRT




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: ~user/cgi_bin script config problem - THANKS!

Posted by mark rostron <mr...@real.com>.
Thanks for your help on this.
Looked into the suexec.log and found that the cgi-bin directory and any cgi 
files in it were failing because they were 777 permissions, which the server 
did not allow.

On Friday 01 February 2002 17:38, Joshua Slive wrote:
> > From: mark rostron [mailto:mrostron@real.com]
> >
> > yeah - changed my mind about the attachments.
> > Anyway, I checked the script and it appears to be working from
> > command-line
> > and also if I copy the test script into /usr/local/httpd/cgi-bin
> > (ScriptAlias
> > definition).
> > There is something in the way I'm configuring the public-html/cgi-bin
> > directory.
> > Below is the text of the stanza defining configuration for public_html:
>
> How come everybody is only reading half my posts today?  If it works in the
> main cgi-bin, but you get "premature end of script headers" elsewhere, then
> the most likely answer is suexec.  Check to see if you are using it, and
> check the contents of the suexec log file.
>
> The fact that you get "premature end of script headers" means that the
> apache configuration is fine: it is trying to launch your cgi script.  The
> lanuch is failing, either because there is something wrong with the script,
> or an intermediary (suexec) is failing.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
as you were ...
rostron out

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: ~user/cgi_bin script config problem - approx 20k attached

Posted by Joshua Slive <jo...@slive.ca>.
> From: mark rostron [mailto:mrostron@real.com]

> yeah - changed my mind about the attachments.
> Anyway, I checked the script and it appears to be working from
> command-line
> and also if I copy the test script into /usr/local/httpd/cgi-bin
> (ScriptAlias
> definition).
> There is something in the way I'm configuring the public-html/cgi-bin
> directory.
> Below is the text of the stanza defining configuration for public_html:

How come everybody is only reading half my posts today?  If it works in the
main cgi-bin, but you get "premature end of script headers" elsewhere, then
the most likely answer is suexec.  Check to see if you are using it, and
check the contents of the suexec log file.

The fact that you get "premature end of script headers" means that the
apache configuration is fine: it is trying to launch your cgi script.  The
lanuch is failing, either because there is something wrong with the script,
or an intermediary (suexec) is failing.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: ~user/cgi_bin script config problem - approx 20k attached

Posted by mark rostron <mr...@real.com>.
yeah - changed my mind about the attachments.
Anyway, I checked the script and it appears to be working from command-line 
and also if I copy the test script into /usr/local/httpd/cgi-bin (ScriptAlias 
definition).
There is something in the way I'm configuring the public-html/cgi-bin 
directory.
Below is the text of the stanza defining configuration for public_html:

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
 
<Directory /home/*/public_html/cgi-bin>
Options +ExecCGI +Indexes
</Directory>

Can you spot anything from this?




On Friday 01 February 2002 16:46, Joshua Slive wrote:
> > From: mark rostron [mailto:mrostron@real.com]
> >
> > httpd -v output:
> >
> > Server version: Apache/1.3.19 (Unix)  (SuSE/Linux)
> > Server built:   May 14 2001 15:46:52
> >
> > I am attempting to configure apache 1.3.19 (suse 7.2
> > distribution) to enable
> > user cgi-bin scripting by enabling ExecCGI for directory
> > /home/username/public_html/cgi-bin
> > But with no luck.
> > Attached are compressed versions of httpd.conf, together with the
> > inclusion
> > for public_html/cgi-bin execution.
>
> Luckily you failed to attach them.  Please don't send big attachments
> unless it is really necessary.
>
> > I have tested the script by putting into the ScriptAlias directory
> > for /cgi-bin/ and the script worked fine.
> >
> > the error message in error_log is:
> >
> > [Fri Feb  1 16:32:08 2002] [error] [client 127.0.0.2] Premature
> > end of script
> > headers: /home/mrostron/public_html/cgi-bin/test.cgi
>
> This means there is something wrong with the cgi script:
> http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers
>
> One thing to check is to look for an suexec log file if you are using
> suexec (httpd -l will tell you).
>
> Beyond that, you basically just have a broken cgi script.  Try running it
> from the command prompt.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
as you were ...
rostron out

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: ~user/cgi_bin script config problem - approx 20k attached

Posted by Joshua Slive <jo...@slive.ca>.
> From: mark rostron [mailto:mrostron@real.com]

> httpd -v output:
>
> Server version: Apache/1.3.19 (Unix)  (SuSE/Linux)
> Server built:   May 14 2001 15:46:52
>
> I am attempting to configure apache 1.3.19 (suse 7.2
> distribution) to enable
> user cgi-bin scripting by enabling ExecCGI for directory
> /home/username/public_html/cgi-bin
> But with no luck.
> Attached are compressed versions of httpd.conf, together with the
> inclusion
> for public_html/cgi-bin execution.

Luckily you failed to attach them.  Please don't send big attachments unless
it is really necessary.

> I have tested the script by putting into the ScriptAlias directory
> for /cgi-bin/ and the script worked fine.
>
> the error message in error_log is:
>
> [Fri Feb  1 16:32:08 2002] [error] [client 127.0.0.2] Premature
> end of script
> headers: /home/mrostron/public_html/cgi-bin/test.cgi

This means there is something wrong with the cgi script:
http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers

One thing to check is to look for an suexec log file if you are using suexec
(httpd -l will tell you).

Beyond that, you basically just have a broken cgi script.  Try running it
from the command prompt.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org