I managed to get it working.
First I tried to copy files from the lib folder (.cmxs etc), but did not manage to solve all dependencies. It would probably have worked if I had spent some more time figuring out what was still missing. So I installed opam2 and installed the packages using the destdir folder (/opt/myapp)
for p in `opam2 list | cut -d ' ' -f 1`; do opam2 install --destdir /opt/myapp/ $p ; done
(This is all, so I still have a job to do to figure out which I can do without)
Also installed the Osigen app under /opt/myapp/
The whole folder was then copied a target node under /opt/myapp/
To solve paths I had to crate a new findlib.conf file and put it under /opt/myapp/etc/
$ cat /opt/myapp/etc/findlib.conf
destdir="/opt/myapp/lib"
path="/opt/myapp/lib"
ocamlc="ocamlc.opt"
ocamlopt="ocamlopt.opt"
ocamldep="ocamldep.opt"
ocamldoc="ocamldoc.opt"
To run it, have have this script setting the environment
$ cat /opt/myapp/run.sh
#!/bin/bash
MYTOP=/opt/myapp/
CAML_LD_LIBRARY_PATH=$MYTOP/lib/stublibs
MANPATH=:$MYTOP/man
PERL5LIB=$MYTOP/lib/perl5:
OCAML_TOPLEVEL_PATH=/lib/toplevel
PATH=$MYTOP/bin:$PATH
OCAMLPATH=$MYTOP
export OCAMLFIND_CONF=$MYTOP/etc/findlib.conf
ocsigenserver.opt -c $MYTOP/etc/myapp/myapp.conf
Also, oscigenserver seems to use the ~/.opam2/4.06.1/ paths form extensions loaded, so these have to be configured.
Got this kind of log messages
ocsigenserver.opt: ocsipersist:dbm: Launching a new Ocsidbm process: /home/hans/.opam2/4.06.1/lib/ocsigenserver/extensions/ocsidbm.opt on directory /opt/myapp/var/data/myapp/ocsipersist.
Needed to change the configuration of the module to use the right path for the binary
vi /opt/myapp/etc/myapp/myapp.conf
...
<extension findlib-package="ocsigenserver.ext.ocsipersist-dbm">
<ocsidbm name="/opt/myapp/lib/ocsigenserver/extensions/ocsidbm.opt"/>
</extension>
...
Still have a problem with mime-types, but it's probably a similar config change.
So it's not totally smooth, but it seems to be doable.
Regards,
Hans Ole Rafaelsen