The easiest way to initialize, compile, and run a project in Ocsigen/Eliom is to use the Eliom distillery eliom-distillery.
It is self-documenting (refer to eliom-distillery -help and the generated README), but here is a bit information on how to work with it.
The eliom-distillery creates projects from templates. Template "basic" create a very simple project (makefiles and configuration file and main service).
To create your project, do:
$ eliom-distillery -name <name> -template basic.ppx [-target-directory <dir>]
This creates a project named <name> from the "basic.ppx" template in the directory <dir> or <name> by default. The project name should be a valid name for an OCaml compilation unit. The project directory contains the following files
This is your initial source file. All Eliom files (*.eliom, *.eliomi) in this directory are automatically considered. To add a .ml/.mli file to your project, add it to the variable SERVER_FILES or CLIENT_FILES in Makefile.options.
The content of this folder is statically served. It contains initially a basic CSS file for your project.
Configure your project here!
This file is a template for the configuration file for ocsigenserver. You will rarely need to edit it: it can be personalized through variables in Makefile.options. In particular, this way, the installation rules and the configuration files remains coherent.
This contains all rules necessary to build, test, and run your Eliom application. You should avoid modifying it. See below for the relevant targets.
An explanation of how to compile, test, install, and run your application
Compilation & Running: Read the README
You can just run
$ make test.byte
$ make test.opt
to compile your project and run ocsigenserver with it.
Please refer to the generated README file for further hints on how to work with your project.