You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Shawn Wilson <sh...@atmreports.com> on 2003/01/29 22:41:10 UTC

[users@httpd] CGI problem with mod_userdir

Hello,

I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user 
public_html directories. The problem I'm running into is trying to allow 
the execution of CGI scripts in those directories. A VERY simple script 
which works in the normal web root does not work in the user's directory 
even though I have ExecCGI enabled for both. All I get in my server logs 
is "Premature end of script headers" which usually implies an error 
running the script. However, I know the script works because I can move 
it elsewhere and it executes fine.

Here's a sample from my httpd.conf:
-------------------------------------
<Location />
     Options ExecCGI
</Location>

UserDir public_html
<Directory /home/*/public_html>
     Options ExecCGI
</Directory>
---------------------------------------

I can change my <Location> tags to <Directory> tags and vice-versa 
(changing the paths too) and the results are the same... it works for 
"/" but not "/home/*/public_html".

Here's my CGI script:
----------------------------------------
#!/usr/bin/perl

print "Content-type: text/html\r\n\r\n";
print "Script testing!";
------------------------------------------

And here's the error from my error log when it fails:
------------------------------------------------------
[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end 
of script headers: test.cgi
------------------------------------------------------

I've checked permissions, execute bit, etc. and it all seems to be set 
okay. It's just a matter of the file being in /home/*/public_html (and 
served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir 
issue? Any help would be appreciated.

Thanks,
-shawn

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
More times than I wish :)

Jeff Cohen wrote:
> Did you restart the apache service in order to reapply the new settings?
> 
> Jeff Cohen
> 
> 
>>-----Original Message-----
>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>Sent: Wednesday, January 29, 2003 7:09 PM
>>To: users@httpd.apache.org
>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>
>>Thanks Jeff, I incresed the output to include debug but that didn't
>>provide any additional output for this request.
>>
>>-shawn
>>
>>Jeff Cohen wrote:
>>
>>>Yes, there is the error log options, try changing your httpd.conf file
>>
>>line
>>
>>>from LogLevel warn to LogLevel debug.
>>>
>>>All the best,
>>>Jeff Cohen
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>>>Sent: Wednesday, January 29, 2003 4:47 PM
>>>>To: users@httpd.apache.org
>>>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>>>
>>>>As a side note... is there any way I can increase the error reporting /
>>>>debugging so that I can get a little more detail as far as what might be
>>>>going on?
>>>>
>>>>Thanks,
>>>>-shawn
>>>>
>>>>Shawn Wilson wrote:
>>>>
>>>>
>>>>>Hello,
>>>>>
>>>>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
>>>>>public_html directories. The problem I'm running into is trying to
>>
>>allow
>>
>>>>>the execution of CGI scripts in those directories. A VERY simple script
>>>>>which works in the normal web root does not work in the user's
>>
>>directory
>>
>>>>>even though I have ExecCGI enabled for both. All I get in my server
>>
>>logs
>>
>>>>>is "Premature end of script headers" which usually implies an error
>>>>>running the script. However, I know the script works because I can move
>>>>>it elsewhere and it executes fine.
>>>>>
>>>>>Here's a sample from my httpd.conf:
>>>>>-------------------------------------
>>>>><Location />
>>>>>   Options ExecCGI
>>>>></Location>
>>>>>
>>>>>UserDir public_html
>>>>><Directory /home/*/public_html>
>>>>>   Options ExecCGI
>>>>></Directory>
>>>>>---------------------------------------
>>>>>
>>>>>I can change my <Location> tags to <Directory> tags and vice-versa
>>>>>(changing the paths too) and the results are the same... it works for
>>>>>"/" but not "/home/*/public_html".
>>>>>
>>>>>Here's my CGI script:
>>>>>----------------------------------------
>>>>>#!/usr/bin/perl
>>>>>
>>>>>print "Content-type: text/html\r\n\r\n";
>>>>>print "Script testing!";
>>>>>------------------------------------------
>>>>>
>>>>>And here's the error from my error log when it fails:
>>>>>------------------------------------------------------
>>>>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
>>>>>of script headers: test.cgi
>>>>>------------------------------------------------------
>>>>>
>>>>>I've checked permissions, execute bit, etc. and it all seems to be set
>>>>>okay. It's just a matter of the file being in /home/*/public_html (and
>>>>>served through mod_userdir) vs. /var/www/blahblah. Is this a
>>
>>mod_userdir
>>
>>>>>issue? Any help would be appreciated.
>>>>>
>>>>>Thanks,
>>>>>-shawn
>>>>>
>>>>
>>>>--
>>>>====================================
>>>>Shawn Wilson [shawnw@atmreports.com]
>>>>Software Developer, ATMReports.com
>>>>PH: 877-327-0873, FAX: 406-294-5806
>>>>====================================
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>For additional commands, e-mail: users-help@httpd.apache.org
>>
>>--
>>====================================
>>Shawn Wilson [shawnw@atmreports.com]
>>Software Developer, ATMReports.com
>>PH: 877-327-0873, FAX: 406-294-5806
>>====================================
> 
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

RE: [users@httpd] CGI problem with mod_userdir

Posted by Jeff Cohen <ap...@gej-it.com>.
Did you restart the apache service in order to reapply the new settings?

Jeff Cohen

> -----Original Message-----
> From: Shawn Wilson [mailto:shawnw@atmreports.com]
> Sent: Wednesday, January 29, 2003 7:09 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] CGI problem with mod_userdir
> 
> Thanks Jeff, I incresed the output to include debug but that didn't
> provide any additional output for this request.
> 
> -shawn
> 
> Jeff Cohen wrote:
> > Yes, there is the error log options, try changing your httpd.conf file
> line
> > from LogLevel warn to LogLevel debug.
> >
> > All the best,
> > Jeff Cohen
> >
> >
> >>-----Original Message-----
> >>From: Shawn Wilson [mailto:shawnw@atmreports.com]
> >>Sent: Wednesday, January 29, 2003 4:47 PM
> >>To: users@httpd.apache.org
> >>Subject: Re: [users@httpd] CGI problem with mod_userdir
> >>
> >>As a side note... is there any way I can increase the error reporting /
> >>debugging so that I can get a little more detail as far as what might be
> >>going on?
> >>
> >>Thanks,
> >>-shawn
> >>
> >>Shawn Wilson wrote:
> >>
> >>>Hello,
> >>>
> >>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
> >>>public_html directories. The problem I'm running into is trying to
> allow
> >>>the execution of CGI scripts in those directories. A VERY simple script
> >>>which works in the normal web root does not work in the user's
> directory
> >>>even though I have ExecCGI enabled for both. All I get in my server
> logs
> >>>is "Premature end of script headers" which usually implies an error
> >>>running the script. However, I know the script works because I can move
> >>>it elsewhere and it executes fine.
> >>>
> >>>Here's a sample from my httpd.conf:
> >>>-------------------------------------
> >>><Location />
> >>>    Options ExecCGI
> >>></Location>
> >>>
> >>>UserDir public_html
> >>><Directory /home/*/public_html>
> >>>    Options ExecCGI
> >>></Directory>
> >>>---------------------------------------
> >>>
> >>>I can change my <Location> tags to <Directory> tags and vice-versa
> >>>(changing the paths too) and the results are the same... it works for
> >>>"/" but not "/home/*/public_html".
> >>>
> >>>Here's my CGI script:
> >>>----------------------------------------
> >>>#!/usr/bin/perl
> >>>
> >>>print "Content-type: text/html\r\n\r\n";
> >>>print "Script testing!";
> >>>------------------------------------------
> >>>
> >>>And here's the error from my error log when it fails:
> >>>------------------------------------------------------
> >>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
> >>>of script headers: test.cgi
> >>>------------------------------------------------------
> >>>
> >>>I've checked permissions, execute bit, etc. and it all seems to be set
> >>>okay. It's just a matter of the file being in /home/*/public_html (and
> >>>served through mod_userdir) vs. /var/www/blahblah. Is this a
> mod_userdir
> >>>issue? Any help would be appreciated.
> >>>
> >>>Thanks,
> >>>-shawn
> >>>
> >>
> >>--
> >>====================================
> >>Shawn Wilson [shawnw@atmreports.com]
> >>Software Developer, ATMReports.com
> >>PH: 877-327-0873, FAX: 406-294-5806
> >>====================================
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> 
> --
> ====================================
> Shawn Wilson [shawnw@atmreports.com]
> Software Developer, ATMReports.com
> PH: 877-327-0873, FAX: 406-294-5806
> ====================================


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Thanks Jeff, I incresed the output to include debug but that didn't 
provide any additional output for this request.

-shawn

Jeff Cohen wrote:
> Yes, there is the error log options, try changing your httpd.conf file line
> from LogLevel warn to LogLevel debug.
> 
> All the best,
> Jeff Cohen
> 
> 
>>-----Original Message-----
>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>Sent: Wednesday, January 29, 2003 4:47 PM
>>To: users@httpd.apache.org
>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>
>>As a side note... is there any way I can increase the error reporting /
>>debugging so that I can get a little more detail as far as what might be
>>going on?
>>
>>Thanks,
>>-shawn
>>
>>Shawn Wilson wrote:
>>
>>>Hello,
>>>
>>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
>>>public_html directories. The problem I'm running into is trying to allow
>>>the execution of CGI scripts in those directories. A VERY simple script
>>>which works in the normal web root does not work in the user's directory
>>>even though I have ExecCGI enabled for both. All I get in my server logs
>>>is "Premature end of script headers" which usually implies an error
>>>running the script. However, I know the script works because I can move
>>>it elsewhere and it executes fine.
>>>
>>>Here's a sample from my httpd.conf:
>>>-------------------------------------
>>><Location />
>>>    Options ExecCGI
>>></Location>
>>>
>>>UserDir public_html
>>><Directory /home/*/public_html>
>>>    Options ExecCGI
>>></Directory>
>>>---------------------------------------
>>>
>>>I can change my <Location> tags to <Directory> tags and vice-versa
>>>(changing the paths too) and the results are the same... it works for
>>>"/" but not "/home/*/public_html".
>>>
>>>Here's my CGI script:
>>>----------------------------------------
>>>#!/usr/bin/perl
>>>
>>>print "Content-type: text/html\r\n\r\n";
>>>print "Script testing!";
>>>------------------------------------------
>>>
>>>And here's the error from my error log when it fails:
>>>------------------------------------------------------
>>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
>>>of script headers: test.cgi
>>>------------------------------------------------------
>>>
>>>I've checked permissions, execute bit, etc. and it all seems to be set
>>>okay. It's just a matter of the file being in /home/*/public_html (and
>>>served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir
>>>issue? Any help would be appreciated.
>>>
>>>Thanks,
>>>-shawn
>>>
>>
>>--
>>====================================
>>Shawn Wilson [shawnw@atmreports.com]
>>Software Developer, ATMReports.com
>>PH: 877-327-0873, FAX: 406-294-5806
>>====================================
> 
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

RE: [users@httpd] CGI problem with mod_userdir

Posted by Jeff Cohen <ap...@gej-it.com>.
Yes, there is the error log options, try changing your httpd.conf file line
from LogLevel warn to LogLevel debug.

All the best,
Jeff Cohen

> -----Original Message-----
> From: Shawn Wilson [mailto:shawnw@atmreports.com]
> Sent: Wednesday, January 29, 2003 4:47 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] CGI problem with mod_userdir
> 
> As a side note... is there any way I can increase the error reporting /
> debugging so that I can get a little more detail as far as what might be
> going on?
> 
> Thanks,
> -shawn
> 
> Shawn Wilson wrote:
> > Hello,
> >
> > I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
> > public_html directories. The problem I'm running into is trying to allow
> > the execution of CGI scripts in those directories. A VERY simple script
> > which works in the normal web root does not work in the user's directory
> > even though I have ExecCGI enabled for both. All I get in my server logs
> > is "Premature end of script headers" which usually implies an error
> > running the script. However, I know the script works because I can move
> > it elsewhere and it executes fine.
> >
> > Here's a sample from my httpd.conf:
> > -------------------------------------
> > <Location />
> >     Options ExecCGI
> > </Location>
> >
> > UserDir public_html
> > <Directory /home/*/public_html>
> >     Options ExecCGI
> > </Directory>
> > ---------------------------------------
> >
> > I can change my <Location> tags to <Directory> tags and vice-versa
> > (changing the paths too) and the results are the same... it works for
> > "/" but not "/home/*/public_html".
> >
> > Here's my CGI script:
> > ----------------------------------------
> > #!/usr/bin/perl
> >
> > print "Content-type: text/html\r\n\r\n";
> > print "Script testing!";
> > ------------------------------------------
> >
> > And here's the error from my error log when it fails:
> > ------------------------------------------------------
> > [Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
> > of script headers: test.cgi
> > ------------------------------------------------------
> >
> > I've checked permissions, execute bit, etc. and it all seems to be set
> > okay. It's just a matter of the file being in /home/*/public_html (and
> > served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir
> > issue? Any help would be appreciated.
> >
> > Thanks,
> > -shawn
> >
> 
> --
> ====================================
> Shawn Wilson [shawnw@atmreports.com]
> Software Developer, ATMReports.com
> PH: 877-327-0873, FAX: 406-294-5806
> ====================================


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
As a side note... is there any way I can increase the error reporting / 
debugging so that I can get a little more detail as far as what might be 
going on?

Thanks,
-shawn

Shawn Wilson wrote:
> Hello,
> 
> I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user 
> public_html directories. The problem I'm running into is trying to allow 
> the execution of CGI scripts in those directories. A VERY simple script 
> which works in the normal web root does not work in the user's directory 
> even though I have ExecCGI enabled for both. All I get in my server logs 
> is "Premature end of script headers" which usually implies an error 
> running the script. However, I know the script works because I can move 
> it elsewhere and it executes fine.
> 
> Here's a sample from my httpd.conf:
> -------------------------------------
> <Location />
>     Options ExecCGI
> </Location>
> 
> UserDir public_html
> <Directory /home/*/public_html>
>     Options ExecCGI
> </Directory>
> ---------------------------------------
> 
> I can change my <Location> tags to <Directory> tags and vice-versa 
> (changing the paths too) and the results are the same... it works for 
> "/" but not "/home/*/public_html".
> 
> Here's my CGI script:
> ----------------------------------------
> #!/usr/bin/perl
> 
> print "Content-type: text/html\r\n\r\n";
> print "Script testing!";
> ------------------------------------------
> 
> And here's the error from my error log when it fails:
> ------------------------------------------------------
> [Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end 
> of script headers: test.cgi
> ------------------------------------------------------
> 
> I've checked permissions, execute bit, etc. and it all seems to be set 
> okay. It's just a matter of the file being in /home/*/public_html (and 
> served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir 
> issue? Any help would be appreciated.
> 
> Thanks,
> -shawn
> 

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 30 Jan 2003, Shawn Wilson wrote:

> THANK YOU!!!
>
> I can't believe it was something so incredibly simple (I knew it had to
> be something stupid). So, if you don't mind my asking, what is the
> purpose of suexec if Apache doesn't need it? I'm guessing it must have
> some good use and perhaps I just don't have it configured properly.

It makes cgi script run under a different userid than the main apache
binary.  It is useful for isolating cgi scripts from the server and from
each other.  It is especially useful on systems where multiple (perhaps
less-than trusted) users run cgi scripts, but it can also enhance security
on one-user systems by making sure that cgi scripts can't do things under
the webserver userid.

More info at http://httpd.apache.org/docs-2.0/suexec.html

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Jurgen <ap...@squarehosting.com>.
Hi,

suexec is very useful, because it allows you to run cgi processes under the username belonging to a virtual host. Else all scripts have to run under the servers user name, which might be nobody or www or apache or something else and all scripts on the whole server are executed under the same user name.

According to your suexec output you posted before suexec would not execute in a user directory, it will only execute files placed in the directory tree under /var/www.
You should also have a file suexec.log in /var/log/httpd, which is the suexec log.
If you compiled yourself an apache server you could compile suexec with an user directory, but this was not done with the server you are using.

Jurgen


On Thu, 30 Jan 2003 09:35:50 -0700
Shawn Wilson <sh...@atmreports.com> wrote:

> THANK YOU!!!
> 
> I can't believe it was something so incredibly simple (I knew it had to 
> be something stupid). So, if you don't mind my asking, what is the 
> purpose of suexec if Apache doesn't need it? I'm guessing it must have 
> some good use and perhaps I just don't have it configured properly.
> 
> Thanks,
> -shawn
> 
> Joshua Slive wrote:
> > On Thu, 30 Jan 2003, Shawn Wilson wrote:
> > 
> >>There was no suexec.log at that location, so I'm guessing it wasn't
> >>using it? Anyways... I did a "chmod -x" to clear the execute bits for
> >>suexec, but unfortunately that did not solve my problem :(.
> > 
> > 
> > Try again.  Sorry, but the fact that you were running suexec but didn't
> > know it, combined with the fact that the cgi script worked when not going
> > through mod_userdir, makes me lay about 98% odds that it is an suexec
> > problem.
> > 
> > Make absolutely sure that apache is not using suexec (rename it, delete
> > it, whatever), make sure you restart your server, make sure the script
> > still works when not run through mod_userdir, then try again.
> > 
> > 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
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> 
> -- 
> ====================================
> Shawn Wilson [shawnw@atmreports.com]
> Software Developer, ATMReports.com
> PH: 877-327-0873, FAX: 406-294-5806
> ====================================
> 

---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
THANK YOU!!!

I can't believe it was something so incredibly simple (I knew it had to 
be something stupid). So, if you don't mind my asking, what is the 
purpose of suexec if Apache doesn't need it? I'm guessing it must have 
some good use and perhaps I just don't have it configured properly.

Thanks,
-shawn

Joshua Slive wrote:
> On Thu, 30 Jan 2003, Shawn Wilson wrote:
> 
>>There was no suexec.log at that location, so I'm guessing it wasn't
>>using it? Anyways... I did a "chmod -x" to clear the execute bits for
>>suexec, but unfortunately that did not solve my problem :(.
> 
> 
> Try again.  Sorry, but the fact that you were running suexec but didn't
> know it, combined with the fact that the cgi script worked when not going
> through mod_userdir, makes me lay about 98% odds that it is an suexec
> problem.
> 
> Make absolutely sure that apache is not using suexec (rename it, delete
> it, whatever), make sure you restart your server, make sure the script
> still works when not run through mod_userdir, then try again.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 30 Jan 2003, Shawn Wilson wrote:
> There was no suexec.log at that location, so I'm guessing it wasn't
> using it? Anyways... I did a "chmod -x" to clear the execute bits for
> suexec, but unfortunately that did not solve my problem :(.

Try again.  Sorry, but the fact that you were running suexec but didn't
know it, combined with the fact that the cgi script worked when not going
through mod_userdir, makes me lay about 98% odds that it is an suexec
problem.

Make absolutely sure that apache is not using suexec (rename it, delete
it, whatever), make sure you restart your server, make sure the script
still works when not run through mod_userdir, then try again.

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Okay thanks for the info. My output from "suexec -V" looked like this:

  -D AP_DOC_ROOT="/var/www"
  -D AP_GID_MIN=500
  -D AP_HTTPD_USER="apache"
  -D AP_LOG_EXEC="/var/log/httpd/suexec.log"
  -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
  -D AP_UID_MIN=500
  -D AP_USERDIR_SUFFIX="public_html"

There was no suexec.log at that location, so I'm guessing it wasn't 
using it? Anyways... I did a "chmod -x" to clear the execute bits for 
suexec, but unfortunately that did not solve my problem :(.

Any other suggestions?
-shawn

Joshua Slive wrote:
> On Thu, 30 Jan 2003, Shawn Wilson wrote:
> 
> 
>>Where would the suexec log be kept? This may not be the issue though,
>>since the script _will_ run in the user directory, just not when served
>>through mod_userdir.
> 
> 
> It probably is the issue.  mod_userdir has special hooks to suexec.
> 
> The suexec log is usually kept with your other apache logs.  You should be
> able to execute "suexec -V" to see suexec's settings.  You can also try
> simply doing "chmod -x suexec" to assure that Apache can't launch it and
> then restarting apache.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 30 Jan 2003, Shawn Wilson wrote:

> Where would the suexec log be kept? This may not be the issue though,
> since the script _will_ run in the user directory, just not when served
> through mod_userdir.

It probably is the issue.  mod_userdir has special hooks to suexec.

The suexec log is usually kept with your other apache logs.  You should be
able to execute "suexec -V" to see suexec's settings.  You can also try
simply doing "chmod -x suexec" to assure that Apache can't launch it and
then restarting apache.

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Where would the suexec log be kept? This may not be the issue though, 
since the script _will_ run in the user directory, just not when served 
through mod_userdir.

-shawn

Joshua Slive wrote:
> On Thu, 30 Jan 2003, Shawn Wilson wrote:
> 
> 
>>Is there no resolution to this? Can anyone else reproduce my results?
>>Just trying to keep this thread alive.
> 
> 
> I haven't read the whole thread, but have you checked to see if you are
> using suexec?  Have you checked the suexec log?  That is the most common
> explanation of cgi scripts that work in cgi-bin but not in user
> directories.
> 
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 30 Jan 2003, Shawn Wilson wrote:

> Is there no resolution to this? Can anyone else reproduce my results?
> Just trying to keep this thread alive.

I haven't read the whole thread, but have you checked to see if you are
using suexec?  Have you checked the suexec log?  That is the most common
explanation of cgi scripts that work in cgi-bin but not in user
directories.

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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Is there no resolution to this? Can anyone else reproduce my results? 
Just trying to keep this thread alive.

-shawn

Shawn Wilson wrote:
> Yes that's right... so in my example I am using:
> 
>     http://www.my.domain/~lannocc/test.cgi
> 
> In my two configuration examples, I used an Alias directive so that my 
> physical location is the same, and even the URL is the same. It simply 
> seems to be a matter of telling Apache to use mod_userdir to serve that 
> particular location causes CGI's to fail. Also, I tested this with both 
> a Perl script and a compiled C script... same results.
> 
> This is really starting to bug me... I will have to move back to Apache 
> 1.3 if I don't get this resolved soon :(.
> 
> -shawn
> 
> Jeff Cohen wrote:
> 
>> Let me ask you one more thing, when you are trying to serve the pages, do
>> you go to http://www.domain1.com/~user_name/ or how?
>>
>> Jeff Cohen
>>
>>
>>> -----Original Message-----
>>> From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>> Sent: Wednesday, January 29, 2003 7:32 PM
>>> To: users@httpd.apache.org
>>> Subject: Re: [users@httpd] CGI problem with mod_userdir
>>>
>>> Thanks I didn't think of that... but no it still doesn't work.
>>>
>>> Is this an issue with mod_userdir in Apache 2.0 or a stupid
>>> configuration problem on my part? It all worked fine back in 1.3.
>>>
>>> -shawn
>>>
>>> Jeff Cohen wrote:
>>>
>>>> Instead of doing:
>>>> UserDir public_html
>>>> Try doing:
>>>> UserDir /home/*/public_html
>>>>
>>>> That should work.
>>>>
>>>> All the best,
>>>> Jeff Cohen
>>>>
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>>>> Sent: Wednesday, January 29, 2003 7:16 PM
>>>>> To: users@httpd.apache.org
>>>>> Subject: Re: [users@httpd] CGI problem with mod_userdir
>>>>>
>>>>> Okay, after some further testing I have a very simple test that I 
>>>>> wonder
>>>>> if others can verify the same results or could detail why this occurs.
>>>>>
>>>>> So... I have a file /home/lannocc/public_html/test.cgi that executes
>>>>> just fine. Modifying ONLY my httpd.conf I can do the following which
>>>>> WORKS:
>>>>>
>>>>> --- Begin working config ---
>>>>> UserDir disable
>>>>> Alias /~lannocc /home/lannocc/public_html
>>>>> <Directory /home/lannocc/public_html>
>>>>>    Options ExecCGI
>>>>> </Directory>
>>>>> --- End working config ---
>>>>>
>>>>> The script works fine.
>>>>>
>>>>> But... if I simply change the UserDir directive and remove the Alias
>>>>> definition it no longer works:
>>>>>
>>>>> --- Begin bad config ---
>>>>> UserDir public_html
>>>>> <Directory /home/lannocc/public_html>
>>>>>    Options ExecCGI
>>>>> </Directory>
>>>>> --- End bad config ---
>>>>>
>>>>> Now I get the Server Error 500 - Premature end of script headers... 
>>>>> blah
>>>>> blah blah. I know the UserDir is working because I can access other
>>>>> non-cgi files just fine.
>>>>>
>>>>> PLEASE - tell me I'm just doing something stupid... I can't figure out
>>>>> why this doesn't work!
>>>>>
>>>>> Thanks,
>>>>> -shawn
>>>>>
>>>>> Shawn Wilson wrote:
>>>>>
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
>>>>>> public_html directories. The problem I'm running into is trying to
>>>
>>>
>>> allow
>>>
>>>>>> the execution of CGI scripts in those directories. A VERY simple 
>>>>>> script
>>>>>> which works in the normal web root does not work in the user's
>>>
>>>
>>> directory
>>>
>>>>>> even though I have ExecCGI enabled for both. All I get in my server
>>>
>>>
>>> logs
>>>
>>>>>> is "Premature end of script headers" which usually implies an error
>>>>>> running the script. However, I know the script works because I can 
>>>>>> move
>>>>>> it elsewhere and it executes fine.
>>>>>>
>>>>>> Here's a sample from my httpd.conf:
>>>>>> -------------------------------------
>>>>>> <Location />
>>>>>>   Options ExecCGI
>>>>>> </Location>
>>>>>>
>>>>>> UserDir public_html
>>>>>> <Directory /home/*/public_html>
>>>>>>   Options ExecCGI
>>>>>> </Directory>
>>>>>> ---------------------------------------
>>>>>>
>>>>>> I can change my <Location> tags to <Directory> tags and vice-versa
>>>>>> (changing the paths too) and the results are the same... it works for
>>>>>> "/" but not "/home/*/public_html".
>>>>>>
>>>>>> Here's my CGI script:
>>>>>> ----------------------------------------
>>>>>> #!/usr/bin/perl
>>>>>>
>>>>>> print "Content-type: text/html\r\n\r\n";
>>>>>> print "Script testing!";
>>>>>> ------------------------------------------
>>>>>>
>>>>>> And here's the error from my error log when it fails:
>>>>>> ------------------------------------------------------
>>>>>> [Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] 
>>>>>> Premature end
>>>>>> of script headers: test.cgi
>>>>>> ------------------------------------------------------
>>>>>>
>>>>>> I've checked permissions, execute bit, etc. and it all seems to be 
>>>>>> set
>>>>>> okay. It's just a matter of the file being in /home/*/public_html 
>>>>>> (and
>>>>>> served through mod_userdir) vs. /var/www/blahblah. Is this a
>>>
>>>
>>> mod_userdir
>>>
>>>>>> issue? Any help would be appreciated.
>>>>>>
>>>>>> Thanks,
>>>>>> -shawn
>>>>>>
>>>>>
>>>>> -- 
>>>>> ====================================
>>>>> Shawn Wilson [shawnw@atmreports.com]
>>>>> Software Developer, ATMReports.com
>>>>> PH: 877-327-0873, FAX: 406-294-5806
>>>>> ====================================
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>> -- 
>>> ====================================
>>> Shawn Wilson [shawnw@atmreports.com]
>>> Software Developer, ATMReports.com
>>> PH: 877-327-0873, FAX: 406-294-5806
>>> ====================================
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Yes that's right... so in my example I am using:

     http://www.my.domain/~lannocc/test.cgi

In my two configuration examples, I used an Alias directive so that my 
physical location is the same, and even the URL is the same. It simply 
seems to be a matter of telling Apache to use mod_userdir to serve that 
particular location causes CGI's to fail. Also, I tested this with both 
a Perl script and a compiled C script... same results.

This is really starting to bug me... I will have to move back to Apache 
1.3 if I don't get this resolved soon :(.

-shawn

Jeff Cohen wrote:
> Let me ask you one more thing, when you are trying to serve the pages, do
> you go to http://www.domain1.com/~user_name/ or how?
> 
> Jeff Cohen
> 
> 
>>-----Original Message-----
>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>Sent: Wednesday, January 29, 2003 7:32 PM
>>To: users@httpd.apache.org
>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>
>>Thanks I didn't think of that... but no it still doesn't work.
>>
>>Is this an issue with mod_userdir in Apache 2.0 or a stupid
>>configuration problem on my part? It all worked fine back in 1.3.
>>
>>-shawn
>>
>>Jeff Cohen wrote:
>>
>>>Instead of doing:
>>>UserDir public_html
>>>Try doing:
>>>UserDir /home/*/public_html
>>>
>>>That should work.
>>>
>>>All the best,
>>>Jeff Cohen
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>>>Sent: Wednesday, January 29, 2003 7:16 PM
>>>>To: users@httpd.apache.org
>>>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>>>
>>>>Okay, after some further testing I have a very simple test that I wonder
>>>>if others can verify the same results or could detail why this occurs.
>>>>
>>>>So... I have a file /home/lannocc/public_html/test.cgi that executes
>>>>just fine. Modifying ONLY my httpd.conf I can do the following which
>>>>WORKS:
>>>>
>>>>--- Begin working config ---
>>>>UserDir disable
>>>>Alias /~lannocc /home/lannocc/public_html
>>>><Directory /home/lannocc/public_html>
>>>>    Options ExecCGI
>>>></Directory>
>>>>--- End working config ---
>>>>
>>>>The script works fine.
>>>>
>>>>But... if I simply change the UserDir directive and remove the Alias
>>>>definition it no longer works:
>>>>
>>>>--- Begin bad config ---
>>>>UserDir public_html
>>>><Directory /home/lannocc/public_html>
>>>>    Options ExecCGI
>>>></Directory>
>>>>--- End bad config ---
>>>>
>>>>Now I get the Server Error 500 - Premature end of script headers... blah
>>>>blah blah. I know the UserDir is working because I can access other
>>>>non-cgi files just fine.
>>>>
>>>>PLEASE - tell me I'm just doing something stupid... I can't figure out
>>>>why this doesn't work!
>>>>
>>>>Thanks,
>>>>-shawn
>>>>
>>>>Shawn Wilson wrote:
>>>>
>>>>
>>>>>Hello,
>>>>>
>>>>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
>>>>>public_html directories. The problem I'm running into is trying to
>>
>>allow
>>
>>>>>the execution of CGI scripts in those directories. A VERY simple script
>>>>>which works in the normal web root does not work in the user's
>>
>>directory
>>
>>>>>even though I have ExecCGI enabled for both. All I get in my server
>>
>>logs
>>
>>>>>is "Premature end of script headers" which usually implies an error
>>>>>running the script. However, I know the script works because I can move
>>>>>it elsewhere and it executes fine.
>>>>>
>>>>>Here's a sample from my httpd.conf:
>>>>>-------------------------------------
>>>>><Location />
>>>>>   Options ExecCGI
>>>>></Location>
>>>>>
>>>>>UserDir public_html
>>>>><Directory /home/*/public_html>
>>>>>   Options ExecCGI
>>>>></Directory>
>>>>>---------------------------------------
>>>>>
>>>>>I can change my <Location> tags to <Directory> tags and vice-versa
>>>>>(changing the paths too) and the results are the same... it works for
>>>>>"/" but not "/home/*/public_html".
>>>>>
>>>>>Here's my CGI script:
>>>>>----------------------------------------
>>>>>#!/usr/bin/perl
>>>>>
>>>>>print "Content-type: text/html\r\n\r\n";
>>>>>print "Script testing!";
>>>>>------------------------------------------
>>>>>
>>>>>And here's the error from my error log when it fails:
>>>>>------------------------------------------------------
>>>>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
>>>>>of script headers: test.cgi
>>>>>------------------------------------------------------
>>>>>
>>>>>I've checked permissions, execute bit, etc. and it all seems to be set
>>>>>okay. It's just a matter of the file being in /home/*/public_html (and
>>>>>served through mod_userdir) vs. /var/www/blahblah. Is this a
>>
>>mod_userdir
>>
>>>>>issue? Any help would be appreciated.
>>>>>
>>>>>Thanks,
>>>>>-shawn
>>>>>
>>>>
>>>>--
>>>>====================================
>>>>Shawn Wilson [shawnw@atmreports.com]
>>>>Software Developer, ATMReports.com
>>>>PH: 877-327-0873, FAX: 406-294-5806
>>>>====================================
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
>>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>>>For additional commands, e-mail: users-help@httpd.apache.org
>>
>>--
>>====================================
>>Shawn Wilson [shawnw@atmreports.com]
>>Software Developer, ATMReports.com
>>PH: 877-327-0873, FAX: 406-294-5806
>>====================================
> 
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

RE: [users@httpd] CGI problem with mod_userdir

Posted by Jeff Cohen <ap...@gej-it.com>.
Let me ask you one more thing, when you are trying to serve the pages, do
you go to http://www.domain1.com/~user_name/ or how?

Jeff Cohen

> -----Original Message-----
> From: Shawn Wilson [mailto:shawnw@atmreports.com]
> Sent: Wednesday, January 29, 2003 7:32 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] CGI problem with mod_userdir
> 
> Thanks I didn't think of that... but no it still doesn't work.
> 
> Is this an issue with mod_userdir in Apache 2.0 or a stupid
> configuration problem on my part? It all worked fine back in 1.3.
> 
> -shawn
> 
> Jeff Cohen wrote:
> > Instead of doing:
> > UserDir public_html
> > Try doing:
> > UserDir /home/*/public_html
> >
> > That should work.
> >
> > All the best,
> > Jeff Cohen
> >
> >
> >
> >>-----Original Message-----
> >>From: Shawn Wilson [mailto:shawnw@atmreports.com]
> >>Sent: Wednesday, January 29, 2003 7:16 PM
> >>To: users@httpd.apache.org
> >>Subject: Re: [users@httpd] CGI problem with mod_userdir
> >>
> >>Okay, after some further testing I have a very simple test that I wonder
> >>if others can verify the same results or could detail why this occurs.
> >>
> >>So... I have a file /home/lannocc/public_html/test.cgi that executes
> >>just fine. Modifying ONLY my httpd.conf I can do the following which
> >>WORKS:
> >>
> >>--- Begin working config ---
> >>UserDir disable
> >>Alias /~lannocc /home/lannocc/public_html
> >><Directory /home/lannocc/public_html>
> >>     Options ExecCGI
> >></Directory>
> >>--- End working config ---
> >>
> >>The script works fine.
> >>
> >>But... if I simply change the UserDir directive and remove the Alias
> >>definition it no longer works:
> >>
> >>--- Begin bad config ---
> >>UserDir public_html
> >><Directory /home/lannocc/public_html>
> >>     Options ExecCGI
> >></Directory>
> >>--- End bad config ---
> >>
> >>Now I get the Server Error 500 - Premature end of script headers... blah
> >>blah blah. I know the UserDir is working because I can access other
> >>non-cgi files just fine.
> >>
> >>PLEASE - tell me I'm just doing something stupid... I can't figure out
> >>why this doesn't work!
> >>
> >>Thanks,
> >>-shawn
> >>
> >>Shawn Wilson wrote:
> >>
> >>>Hello,
> >>>
> >>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
> >>>public_html directories. The problem I'm running into is trying to
> allow
> >>>the execution of CGI scripts in those directories. A VERY simple script
> >>>which works in the normal web root does not work in the user's
> directory
> >>>even though I have ExecCGI enabled for both. All I get in my server
> logs
> >>>is "Premature end of script headers" which usually implies an error
> >>>running the script. However, I know the script works because I can move
> >>>it elsewhere and it executes fine.
> >>>
> >>>Here's a sample from my httpd.conf:
> >>>-------------------------------------
> >>><Location />
> >>>    Options ExecCGI
> >>></Location>
> >>>
> >>>UserDir public_html
> >>><Directory /home/*/public_html>
> >>>    Options ExecCGI
> >>></Directory>
> >>>---------------------------------------
> >>>
> >>>I can change my <Location> tags to <Directory> tags and vice-versa
> >>>(changing the paths too) and the results are the same... it works for
> >>>"/" but not "/home/*/public_html".
> >>>
> >>>Here's my CGI script:
> >>>----------------------------------------
> >>>#!/usr/bin/perl
> >>>
> >>>print "Content-type: text/html\r\n\r\n";
> >>>print "Script testing!";
> >>>------------------------------------------
> >>>
> >>>And here's the error from my error log when it fails:
> >>>------------------------------------------------------
> >>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
> >>>of script headers: test.cgi
> >>>------------------------------------------------------
> >>>
> >>>I've checked permissions, execute bit, etc. and it all seems to be set
> >>>okay. It's just a matter of the file being in /home/*/public_html (and
> >>>served through mod_userdir) vs. /var/www/blahblah. Is this a
> mod_userdir
> >>>issue? Any help would be appreciated.
> >>>
> >>>Thanks,
> >>>-shawn
> >>>
> >>
> >>--
> >>====================================
> >>Shawn Wilson [shawnw@atmreports.com]
> >>Software Developer, ATMReports.com
> >>PH: 877-327-0873, FAX: 406-294-5806
> >>====================================
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> 
> --
> ====================================
> Shawn Wilson [shawnw@atmreports.com]
> Software Developer, ATMReports.com
> PH: 877-327-0873, FAX: 406-294-5806
> ====================================


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Thanks I didn't think of that... but no it still doesn't work.

Is this an issue with mod_userdir in Apache 2.0 or a stupid 
configuration problem on my part? It all worked fine back in 1.3.

-shawn

Jeff Cohen wrote:
> Instead of doing:
> UserDir public_html
> Try doing:
> UserDir /home/*/public_html
> 
> That should work.
> 
> All the best,
> Jeff Cohen
> 
> 
> 
>>-----Original Message-----
>>From: Shawn Wilson [mailto:shawnw@atmreports.com]
>>Sent: Wednesday, January 29, 2003 7:16 PM
>>To: users@httpd.apache.org
>>Subject: Re: [users@httpd] CGI problem with mod_userdir
>>
>>Okay, after some further testing I have a very simple test that I wonder
>>if others can verify the same results or could detail why this occurs.
>>
>>So... I have a file /home/lannocc/public_html/test.cgi that executes
>>just fine. Modifying ONLY my httpd.conf I can do the following which
>>WORKS:
>>
>>--- Begin working config ---
>>UserDir disable
>>Alias /~lannocc /home/lannocc/public_html
>><Directory /home/lannocc/public_html>
>>     Options ExecCGI
>></Directory>
>>--- End working config ---
>>
>>The script works fine.
>>
>>But... if I simply change the UserDir directive and remove the Alias
>>definition it no longer works:
>>
>>--- Begin bad config ---
>>UserDir public_html
>><Directory /home/lannocc/public_html>
>>     Options ExecCGI
>></Directory>
>>--- End bad config ---
>>
>>Now I get the Server Error 500 - Premature end of script headers... blah
>>blah blah. I know the UserDir is working because I can access other
>>non-cgi files just fine.
>>
>>PLEASE - tell me I'm just doing something stupid... I can't figure out
>>why this doesn't work!
>>
>>Thanks,
>>-shawn
>>
>>Shawn Wilson wrote:
>>
>>>Hello,
>>>
>>>I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
>>>public_html directories. The problem I'm running into is trying to allow
>>>the execution of CGI scripts in those directories. A VERY simple script
>>>which works in the normal web root does not work in the user's directory
>>>even though I have ExecCGI enabled for both. All I get in my server logs
>>>is "Premature end of script headers" which usually implies an error
>>>running the script. However, I know the script works because I can move
>>>it elsewhere and it executes fine.
>>>
>>>Here's a sample from my httpd.conf:
>>>-------------------------------------
>>><Location />
>>>    Options ExecCGI
>>></Location>
>>>
>>>UserDir public_html
>>><Directory /home/*/public_html>
>>>    Options ExecCGI
>>></Directory>
>>>---------------------------------------
>>>
>>>I can change my <Location> tags to <Directory> tags and vice-versa
>>>(changing the paths too) and the results are the same... it works for
>>>"/" but not "/home/*/public_html".
>>>
>>>Here's my CGI script:
>>>----------------------------------------
>>>#!/usr/bin/perl
>>>
>>>print "Content-type: text/html\r\n\r\n";
>>>print "Script testing!";
>>>------------------------------------------
>>>
>>>And here's the error from my error log when it fails:
>>>------------------------------------------------------
>>>[Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
>>>of script headers: test.cgi
>>>------------------------------------------------------
>>>
>>>I've checked permissions, execute bit, etc. and it all seems to be set
>>>okay. It's just a matter of the file being in /home/*/public_html (and
>>>served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir
>>>issue? Any help would be appreciated.
>>>
>>>Thanks,
>>>-shawn
>>>
>>
>>--
>>====================================
>>Shawn Wilson [shawnw@atmreports.com]
>>Software Developer, ATMReports.com
>>PH: 877-327-0873, FAX: 406-294-5806
>>====================================
> 
> 
> 
> ---------------------------------------------------------------------
> 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
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================

RE: [users@httpd] CGI problem with mod_userdir

Posted by Jeff Cohen <ap...@gej-it.com>.
Instead of doing:
UserDir public_html
Try doing:
UserDir /home/*/public_html

That should work.

All the best,
Jeff Cohen


> -----Original Message-----
> From: Shawn Wilson [mailto:shawnw@atmreports.com]
> Sent: Wednesday, January 29, 2003 7:16 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] CGI problem with mod_userdir
> 
> Okay, after some further testing I have a very simple test that I wonder
> if others can verify the same results or could detail why this occurs.
> 
> So... I have a file /home/lannocc/public_html/test.cgi that executes
> just fine. Modifying ONLY my httpd.conf I can do the following which
> WORKS:
> 
> --- Begin working config ---
> UserDir disable
> Alias /~lannocc /home/lannocc/public_html
> <Directory /home/lannocc/public_html>
>      Options ExecCGI
> </Directory>
> --- End working config ---
> 
> The script works fine.
> 
> But... if I simply change the UserDir directive and remove the Alias
> definition it no longer works:
> 
> --- Begin bad config ---
> UserDir public_html
> <Directory /home/lannocc/public_html>
>      Options ExecCGI
> </Directory>
> --- End bad config ---
> 
> Now I get the Server Error 500 - Premature end of script headers... blah
> blah blah. I know the UserDir is working because I can access other
> non-cgi files just fine.
> 
> PLEASE - tell me I'm just doing something stupid... I can't figure out
> why this doesn't work!
> 
> Thanks,
> -shawn
> 
> Shawn Wilson wrote:
> > Hello,
> >
> > I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user
> > public_html directories. The problem I'm running into is trying to allow
> > the execution of CGI scripts in those directories. A VERY simple script
> > which works in the normal web root does not work in the user's directory
> > even though I have ExecCGI enabled for both. All I get in my server logs
> > is "Premature end of script headers" which usually implies an error
> > running the script. However, I know the script works because I can move
> > it elsewhere and it executes fine.
> >
> > Here's a sample from my httpd.conf:
> > -------------------------------------
> > <Location />
> >     Options ExecCGI
> > </Location>
> >
> > UserDir public_html
> > <Directory /home/*/public_html>
> >     Options ExecCGI
> > </Directory>
> > ---------------------------------------
> >
> > I can change my <Location> tags to <Directory> tags and vice-versa
> > (changing the paths too) and the results are the same... it works for
> > "/" but not "/home/*/public_html".
> >
> > Here's my CGI script:
> > ----------------------------------------
> > #!/usr/bin/perl
> >
> > print "Content-type: text/html\r\n\r\n";
> > print "Script testing!";
> > ------------------------------------------
> >
> > And here's the error from my error log when it fails:
> > ------------------------------------------------------
> > [Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end
> > of script headers: test.cgi
> > ------------------------------------------------------
> >
> > I've checked permissions, execute bit, etc. and it all seems to be set
> > okay. It's just a matter of the file being in /home/*/public_html (and
> > served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir
> > issue? Any help would be appreciated.
> >
> > Thanks,
> > -shawn
> >
> 
> --
> ====================================
> Shawn Wilson [shawnw@atmreports.com]
> Software Developer, ATMReports.com
> PH: 877-327-0873, FAX: 406-294-5806
> ====================================


---------------------------------------------------------------------
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
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI problem with mod_userdir

Posted by Shawn Wilson <sh...@atmreports.com>.
Okay, after some further testing I have a very simple test that I wonder 
if others can verify the same results or could detail why this occurs.

So... I have a file /home/lannocc/public_html/test.cgi that executes 
just fine. Modifying ONLY my httpd.conf I can do the following which WORKS:

--- Begin working config ---
UserDir disable
Alias /~lannocc /home/lannocc/public_html
<Directory /home/lannocc/public_html>
     Options ExecCGI
</Directory>
--- End working config ---

The script works fine.

But... if I simply change the UserDir directive and remove the Alias 
definition it no longer works:

--- Begin bad config ---
UserDir public_html
<Directory /home/lannocc/public_html>
     Options ExecCGI
</Directory>
--- End bad config ---

Now I get the Server Error 500 - Premature end of script headers... blah 
blah blah. I know the UserDir is working because I can access other 
non-cgi files just fine.

PLEASE - tell me I'm just doing something stupid... I can't figure out 
why this doesn't work!

Thanks,
-shawn

Shawn Wilson wrote:
> Hello,
> 
> I'm using httpd-2.0.40-11 I'm using mod_userdir to configure user 
> public_html directories. The problem I'm running into is trying to allow 
> the execution of CGI scripts in those directories. A VERY simple script 
> which works in the normal web root does not work in the user's directory 
> even though I have ExecCGI enabled for both. All I get in my server logs 
> is "Premature end of script headers" which usually implies an error 
> running the script. However, I know the script works because I can move 
> it elsewhere and it executes fine.
> 
> Here's a sample from my httpd.conf:
> -------------------------------------
> <Location />
>     Options ExecCGI
> </Location>
> 
> UserDir public_html
> <Directory /home/*/public_html>
>     Options ExecCGI
> </Directory>
> ---------------------------------------
> 
> I can change my <Location> tags to <Directory> tags and vice-versa 
> (changing the paths too) and the results are the same... it works for 
> "/" but not "/home/*/public_html".
> 
> Here's my CGI script:
> ----------------------------------------
> #!/usr/bin/perl
> 
> print "Content-type: text/html\r\n\r\n";
> print "Script testing!";
> ------------------------------------------
> 
> And here's the error from my error log when it fails:
> ------------------------------------------------------
> [Wed Jan 29 14:17:32 2003] [error] [client 63.168.208.34] Premature end 
> of script headers: test.cgi
> ------------------------------------------------------
> 
> I've checked permissions, execute bit, etc. and it all seems to be set 
> okay. It's just a matter of the file being in /home/*/public_html (and 
> served through mod_userdir) vs. /var/www/blahblah. Is this a mod_userdir 
> issue? Any help would be appreciated.
> 
> Thanks,
> -shawn
> 

-- 
====================================
Shawn Wilson [shawnw@atmreports.com]
Software Developer, ATMReports.com
PH: 877-327-0873, FAX: 406-294-5806
====================================