Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Haskell web application to low-spec server

I'm looking for a way to deploy a Haskell web application on a low-spec toy server. The server specs:

  • OS: debian stable (squeeze) i386
  • CPU: 1 GHz Pentium IV
  • RAM: 512 MB
  • Storage: 512 MB compact flash (mounted on /var), 4 GB USB compact flash (mounted on /)

The server runs fine, it doesn't see much traffic (it's mainly used by myself, friends and family members), and I can afford to run it from my living room because it's completely silent and draw very little power (around 10 W idle, 40 W peak).

Quite obviously, I would like to avoid installing the entire Haskell platform and compile on the server - I'd run out of disk space fairly quickly, and compilation is bound to take ages due to slow storage. I can't just deploy binaries from my development machine though, because that one runs debian testing amd64, so the binaries won't be compatible. My ideas so far:

  • install a VM with debian/i386 to build on
  • figure out a way to build i386 binaries on amd64
  • compile to C on the development machine, copy C sources to server, finish build there (installing gcc or clang on the server is probably acceptable)
  • other ideas?

Which one sounds the most promising? Are option 2 and 3 even possible?

Also, I'm a bit concerned about libraries; the application depends on a few system libraries such as libcairo; installing them on the server is not a problem, but I wonder whether, especially for option 2, this would work (library versions etc.)

like image 814
tdammers Avatar asked Jul 14 '12 08:07

tdammers


1 Answers

Not tried with haskell, but with similar requirements in the past I've found it simplest to just set up a vm with the same version of debian as the target system. Means you don't need to worry about library versioning etc.

like image 126
Richard Huxton Avatar answered Oct 20 '22 20:10

Richard Huxton