Re: UserDir + SetHandler cgi-script broken? (Apache 2.0.52)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 22, 2009 at 8:16 PM, Buck Golemon <buck.golemon@xxxxxxx> wrote:
> I've already posted this on alt.apache.configuration, but this forum seems much
> more active. I'm sorry if this is double-posting. I'm not sure of the
> etiquette...
>
> ---
> I can't get "SetHandler cgi-script" to work from inside a UserDir. If
> I try to access the exact same cgi script using an "Alias", it works
> fine.
>
> works just fine:
> http://pdweb.ca.atitech.com/beg/foo.sh
>
> doesn't work:
> http://pdweb.ca.atitech.com/~bgolemon/foo.sh
>
>
> Here's the relevant configuration. I plan on changing 'bgolemon' to * once I
> get this working, so a ScriptAlias wouldn't work here. Please don't worry about
> security just yet.
> <IfModule mod_userdir.c>
>    UserDir public_html
>    UserDir disabled root
> </IfModule>
> Alias /beg/ "/user/bgolemon/public_html/"
> <Directory "/user/bgolemon/public_html/">
>    Options ExecCGI
>    SetHandler cgi-script
>    AllowOverride None
>    Allow from all
>    Order allow,deny
> </Directory>
>
>
> Here is the error_log for when I try to access ~bgolemon/foo.sh:
> [Thu Jan 22 14:04:34 2009] [error] [client 139.95.112.95] Premature end of
> script headers: foo.sh
>
>
> I also took a look at the ScriptLog. It looks like the script doesn't run at
> all. The result is basically the same with all browsers:
> %% [Thu Jan 22 13:55:32 2009] GET /~bgolemon/foo.py HTTP/1.1
> %% 500 /user/bgolemon/public_html/foo.py
> %request
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.4.154.25 Safari/525.19
> Accept: text/xml,application/xml,application/xhtml+xml,text/
> html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> Accept-Encoding: gzip,deflate,bzip2,sdch
> X-SDCH: Chrome 0.4.154.25
> Accept-Language: en-US,en
> Accept-Charset: ISO-8859-1,*,utf-8
> Host: pdweb.ca.atitech.com
> Connection: Keep-Alive
> %response
> (end of file)
>
>
> In case you want to know, here's the code for foo.sh:
> #!/bin/bash
> echo Content-Type: text/plain
> echo
> echo foo
>
>
> Are there any known issues with this? How can I get this to work? This makes me
> feel like either the cgi-script handler or the UserDir module is broken.
>
> Thanks in advance,
> --Buck

Are you able to access anything in your userdir? Try just sticking a
plain text/html file there and accessing it at /~bgolemon/, just to
make sure user dir is properly configured.

I'm also wondering if perhaps Apache isn't resolving user dirs to
canonical paths. I.e., instead of resolving to
/user/bgolemon/public_html/, it might leave the directory path as
simply ~bgolemon. Afterall, a user's home directory could be in
different places on different systems, (e.g., /home/bgoleman), so it
may just leave it up to the OS to resolve it. If that is the case,
then you're Directory tag won't be applied, you would need another
Directory tag for "~bgolemon". I have no idea if this is the case or
not, but it's worth a try.

Hope that helps a little,
-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux