[racket] Too Many Redirects (Apache)

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Fri Sep 16 13:51:09 EDT 2011

I've done it before, it's easy and works, but I can't seem to find the code...

Jay

On Fri, Sep 16, 2011 at 11:31 AM, John Clements
<clements at brinckerhoff.org> wrote:
>
> On Sep 16, 2011, at 6:59 AM, Jeremy Kun wrote:
>
>> Oops, meant to reply-all
>>
>> Jeremy
>
> One other relevant thought; how hard would it be to throw out Apache and just use setuid to demote racket's privileges after starting? I don't see a built-in binding for setuid--presumably because it's completely platform-specific--but it should be less than 30 lines of code, including the C and the racket. Jay, have you done this? (Maybe this code is just sitting around somewhere?)
>
> John
>
>
>>
>>
>> On Fri, Sep 16, 2011 at 8:59 AM, Jeremy Kun <kun.jeremy at gmail.com> wrote:
>> The redirects are hitting port 8080, via the rules verbatim from that FAQ. Literally, I have the following in my httpd.conf:
>>
>> RewriteEngine on
>> RewriteRule ^(.*)$ http://localhost:8080/$1 [P,NE]
>>
>> So I'm hitting my server at http://racket01.csc.calpoly.edu, and I get that redirect loop.
>>
>> I can't send a request directly to 8080 from outside because my server admin has blocked those ports, hence my desire to do this forwarding. I also can't enable permissions for racket to use <1024 ports via setcap, since the kernel I'm using is not recent enough.
>>
>> And in case this will help, these are my serve/servlet options:
>>
>> (serve/servlet
>>  start
>>  #:launch-browser? #f
>>  #:quit? #f
>>  #:listen-ip #f
>>  #:servlet-path "/"
>>  #:port 8080
>>  #:log-file (build-path "/home/jkun/racket/log.txt")
>>  #:extra-files-paths (list (build-path "/home/jkun/racket")))
>>
>> Any ideas?
>>
>> Jeremy
>>
>>
>>
>> On Fri, Sep 16, 2011 at 6:29 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>> I think I've seen that before and I thought it meant the redirect was
>> set up wrong, but it doesn't seem like you have done that.
>>
>> What URL are the GETs to? What happens when you go to it directly?
>>
>> Jay
>>
>> On Thu, Sep 15, 2011 at 11:13 PM, Jeremy Kun <kun.jeremy at gmail.com> wrote:
>> > I'm trying to set up Apache to redirect to the Racket web server on port
>> > 8080. Originally after modifying my http configuration file to include the
>> > correct RewriteEngine and RewriteRule lines from this page, I got the
>> > following error message:
>> > [Thu Sep 15 21:43:19 2011] [error] (13)Permission denied: proxy: HTTP:
>> > attempt to connect to 127.0.0.1:8080 (*) failed
>> > A quick google search gives that the problem might be in the SELinux
>> > security setting: Allow HTTPD scripts and modules to connect to the
>> > network, which I suppose is turned off. So I ran
>> > sudo /usr/sbin/setsebool httpd_can_network_connect 1
>> > Now it appears to redirect (the racket web server logs show GET requests
>> > from 127.0.0.1), but now it appears to be stuck in an infinite redirect
>> > loop, resulting in the following Apache error message:
>> > [Thu Sep 15 21:57:49 2011] [error] (111)Connection refused: proxy: HTTP:
>> > attempt to connect to 127.0.0.1:8080 (*) failed
>> > And an error page with Error 310 (net::ERR_TOO_MANY_REDIRECTS)
>> > Has anyone else encountered this problem? I can't figure out where the
>> > redirection is breaking down. There aren't any error messages in the racket
>> > error logs, just an unnaturally large number of GET requests from 127.0.0.1.
>> > Regards,
>> > Jeremy
>> >
>> > _________________________________________________
>> >  For list-related administrative tasks:
>> >  http://lists.racket-lang.org/listinfo/users
>> >
>>
>>
>>
>> --
>> Jay McCarthy <jay at cs.byu.edu>
>> Assistant Professor / Brigham Young University
>> http://faculty.cs.byu.edu/~jay
>>
>> "The glory of God is Intelligence" - D&C 93
>>
>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/users
>
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93



Posted on the users mailing list.