[Ur] Ur/Web on MIT Scripts

Benjamin Barenblat bbaren at mit.edu
Sun Jan 4 16:34:08 EST 2015


Hi all—

This message didn’t make it to the Ur mailing list, because I wasn’t
subscribed at the time I sent it.  Here it is.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Friday, January  2, 2015, at  1:45 am EST, Blake Elias wrote:
> Can you tell me how that 6.947 example got put up on scripts in this
> way?

Yes!

The short version is that you need to put ‘prefix /urweb/hello/’ in your
hello.urp file and

    Options +ExecCGI
    AddHandler cgi-script .exe
    RewriteRule hello$ /urweb/hello.exe/index [R]
    RewriteRule hello/$ /urweb/hello.exe/index [R]

in /mit/eliasb/web_scripts/urweb/.htaccess.  Then you can run

    $ urweb -protocol cgi -static hello
    $ cp hello.exe /mit/eliasb/web_scripts/urweb/
    $ fs sa /mit/eliasb/web_scripts/urweb/ daemon.scripts rl

and you should be good to go.

There are several things going on here.  First of all, Ur/Web can
generate three types of executables: standalone web servers (the
default), CGI programs (if compiled with the -protocol cgi option), and
FastCGI programs (if compiled with the -protocol fastcgi option).
You’re evidently building a standalone web server, and Scripts can only
run CGI and FastCGI programs.  For 6.947, I used a CGI program; they’re
much easier to set up and debug, at the expense of performance.  I’d
strongly recommend sticking with a CGI program until you do a final
release of your app, at which point you can reinvestigate FastCGI.

You also have a permissions problem in your Scripts setup – in order to
serve your site, daemon.scripts needs to have at least rl access.

I think that’s all you need to do to get things working.  If you still
have issues, get back in touch!

Best,
Benjamin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQF8BAEBCgBmBQJUpwzYXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5OThCQjVEMTlDOEE3QjE3OUUwREFCODY5
RTczMDE0OUVCOTFDNTNCAAoJEJ5zAUnrkcU709IIAKv0+AscHHFt+5z/T5ISFwHi
nNVRRLvTP1LVo0CEyxi8jxvQFBhWKDAK5qG9U4CsX/O96gMXah5tMbxwBCDAl/V3
WtNi994s8SGI0RiIz0X03DR8GRHBCZrwxxWyihm1hJzRQOIMfoeGACT7QCUlCYEI
5l64/ZL1BDdfvqE2Uh5+saGTMDQa1vZ907yt5EShJ9YowZ6HwD+tgpK1E6f/l4/3
BVwjivDkmpSh+T5mMjL3UYYS9eb6ZDSMhSllLN0Q4buZoFaLiIJHClmuKoj1wKbt
G9/YsQqb4lJktqBD7fdligxfsrkTncd9txi1GVaXtC/tsDReYBxU5LuuYtfJ1BA=
=jrOv
-----END PGP SIGNATURE-----



More information about the Ur mailing list