Arc Forumnew | comments | leaders | submitlogin
Use Apache for static files?
7 points by byronsalty 5927 days ago | 8 comments
I'm probably missing something but I don't see a way to use the asv to serve files (images, js, etc). When I look at arclanguage.org, which is presumably running on asv, the images are all coming from ycombinator.com which is running apache2. I'm guessing the .css file could be coming from a defop too, though a static file probably makes more sense.

Am I missing something (quite possible) or do we either need to add this functionality or use apache or similar to stream the static files.

I'd like to try out arc on something a bit more than a few simple "hello worlds" and basic html.



1 point by tlrobinson 5927 days ago | link

Apache probably offers better performance for static files anyway.

What's the best way to use Apache with another server like asv (on the same host, with the same port). Is a reverse proxy using mod_proxy appropriate? Something else?

-----

1 point by nex3 5927 days ago | link

Using a reverse proxy seems like the best solution with the code we've got.

-----

2 points by byronsalty 5927 days ago | link

Makes sense. Obviously this is better for something being released to the public but during testing I didn't know if (even inefficiently) asv could be used as a one stop shop (a la webrick).

thanks

-----

1 point by nex3 5927 days ago | link

That shouldn't be too hard to hack in, I think... just find some way to capture all /images/* URLs or something and open up a file and send the contents. You might have to be a little careful with MIME types and so forth, but it seems pretty straightforward.

-----

5 points by bogomipz 5927 days ago | link

Just take any URL that is not defop'ed to mean a file name.

Currently, if no op is defined, the server responds with "Unknown operator.". Replace that with the code for opening a file, and if this fails, respond with a proper 404 Not Found message.

-----

3 points by pg 5927 days ago | link

That should work for text/html files.

-----

2 points by bogomipz 5926 days ago | link

By throwing in a hash table which maps from file name extensions to MIME types, it could work for other files as well.

A byte array data type for buffering would do good for performance.

-----

1 point by bcater 5927 days ago | link

I've been playing with blog.arc, and the only thing that I could figure out was to put external files on another server not running Arc.

-----