Arc Forumnew | comments | leaders | submitlogin
help deploying arc to a web server
6 points by jsomers 6104 days ago | 9 comments
Hi,

Thanks to this wonderful forum I've been able to smoothly run and play around with Arc on my machine. Now I'd like to deploy news.arc on a remote server.

So far I've been able to successfully install mzscheme and arc up there, and can get to the REPL with no trouble. This may seem appallingly juvenile, but I was hoping that running "> (nsv)" would magically start up news.example.com just as it did localhost:8080.

What are the steps I'm missing?



4 points by jmatt 6104 days ago | link

I worked on this a few weekends ago. So maybe I can help.

The first thing I would try to do is get nsv to work on your webserver at http://www.example.com/news. There are many ways to do this. If your server has apache running and you do not have root access then you'll want to configure your apache server to pass web traffic to the arc server at a specific port.

I asked around and had someone recommended configuring a virtual host and proxypass (mod_proxy). Proxies are inherently dangerous and you may still need root to configure mod_proxy. There may be other solutions out there though that don't require root, I'm not sure.

To get news.example.com to work you'll want to properly configure your virtual host. To get the web traffic to asv (arc's webserver) you'll want to configure mod_proxy.

Another option, if you are having access trouble on you current web host is to pick up a virtual server at linode | slicehost or similar and set everything up yourself. Worse come to worse you'll learn a lot about configuring a linux / freebsd server. I know I did.

And yes, I'm a little bitter about giving the frustrating "roll your own" answer since it's already overly used in the lisp and scheme communities. I'll make sure to update this thread when I get around to configuring my website(s) for asv.

Some external links:

mod_proxy - http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypas...

linode (what I use) - http://www.linode.com/

slicehost - http://www.slicehost.com/

-----

1 point by jsomers 6104 days ago | link

Thanks for the advice. I've poked around mod_proxy but not sure where to drop those directives. I can lynx to localhost:8080 fine on the server (i.e. the site works locally on the server), so I guess I'm looking for a map from example.com/news -> localhost:8080, which at least seems like progress. Do I need to put some handler in .htaccess, or is that way off base? Ideas?

-----

3 points by kens2 6104 days ago | link

I haven't actually tried this, so my advice is probably worthless, but take a look at "Configure mod_proxy" at http://confluence.atlassian.com/display/DOC/Using+Apache+wit... and use news in place of confluence.

I don't think .htaccess will help you at all; example.com/news exists in "URL-space" not in the filesystem. So you don't need to do anything with a /news directory.

-----

1 point by sacado 6104 days ago | link

maybe you have to type in (load "news.arc") just before (nsv), but I'm not sure.

-----

1 point by jsomers 6104 days ago | link

When I run (nsv) I get the same "ready to serve port 8080," which is a good sign, though I'm almost sure that my server (via shared hosting) isn't going to route everything automatically and properly...

In other words, I expect that there's some config I have to do and I'm not sure what it is.

-----

4 points by almkglor 6104 days ago | link

Do you have apache up?

The port for HTTP should really be port 80. However, I think most of the people here who have deployed the Arc server generally put Apache (serving on port 80) between the real world and the Arc server (serving on port 8080). This is generally done because nobody trusts the Arc server to be hackproof yet, especially not the Anarki version, which has been touched by quite a few people and may not be perfectly secure (but at least has a few more abilities than the Arc2 version).

If you're willing to risk it, then try (nsv 80), which forces the Arc server to listen on 80; you might need to run as root though.

-----

1 point by jsomers 6104 days ago | link

Thanks. This is helpful, but not quite there yet.

I don't have root access, so naturally (nsv 80) gives "listen on 80 failed (Permission denied..." error.

Apache is up, but I'm not sure what I can do with it. Is there a simple redirect I need to run?

To be precise, I've loaded arc2 into a directory [mydomain]/news corresponding to news.[mydomain].com, with the news.arc specifying "news.[mydomain].com" as the site url; I launch the Arc REPL from there ("mzscheme -m -f as.scm") and do "(nsv)"... to no avail.

Thanks for the help so far, really appreciate it.

-----

2 points by almkglor 6104 days ago | link

Try accessing news.[mydomain].com:8080. If you have some sort of terminal access on your remote computer, try lynx http://news.mydomain.com:8080/

As for the Apache <-> Arc talking thing, you'll have to wait for someone else to answer that question; I honestly don't know, because I haven't deployed one yet.

-----

1 point by jsomers 6104 days ago | link

This was my first thought too, although unfortunately I get a network timeout error.

-----