== Requirements == - A web server which supports CGI or FastCGI. - A database or database libraries supported by HaskellDB, unless you use the unsafe and experimental haskelldb-flat back-end. == Install the Hope library == Install the hope package, and optionally any of the separate module packages: - hope-halbum2 - hope-haskell - hope-video === Installation from HackageDB === NOTE: Ignore this for now, Hope is not available from HackageDB yet. The packages are normal Cabal packages, and are available from HackageDB, http://hackage.haskell.org/. Since they depend on several other packages, they are most easily installed by using cabal-install, see http://hackage.haskell.org/trac/hackage/wiki/CabalInstall $ cabal-install install hope Optional: $ cabal-install install hope-halbum2 $ cabal-install install hope-haskell $ cabal-install install hope-video === Installation from source === If you have the source code, for example by getting the darcs repo, you can still install the dependencies from HackageDB. This is most easily done by using cabal-install from 2007-04-09 or later: $ cabal-install build-dep hope*.cabal $ runghc Setup.lhs configure --prefix=$HOME --user $ runghc Setup.lhs build $ runghc Setup.lhs install --user Optionally, do the same in the module-* directories. == Configuration == The site/ directory contains the configuration files and main modules for your Hope installation. - Install the extra dependencies for your setup. - If you are going to use FastCGI, install fastcgi >= 3000.0.0 - If you want to use a real database back-end, you will need to install a HaskellDB driver with its requirements. At the moment HSQL seems to work best, you need the darcs version: $ darcs get --partial http://darcs.haskell.org/HSQL - Edit Config.hs: - Import the modules that you want to use, and add them to configModules. - Edit DBConnect.hs: - Use the connection function for your database, with the right parameters. - Edit htaccess-cgi or htaccess-fcgi (depending on whether you are going to use CGI or FastCGI) to set RewriteBase. - (If needed) Edit ghc_rts_opts.c to set the RTS options for your environment (you can use this to limit the amount of memory that Hope uses, which can be needed in shared hosting environments, or just to keep it from thrashing). == Compile == - Compile (CGI version): $ cd site $ make - Compile (FastCGI version): $ cd site $ make fastcgi === Compiling for running on other machines === If you are going to run Hope on some other machine than then one you compile it on, e.g. your web hosting provider's web server, you probably have to link it statically. Edit Makefile adding -static -optl-static to GHCLINK. When compiling statically on OS X, you can get this error: /usr/bin/ld: can't locate file for: -lcrt0.o "Mac OS X really doesn't like static binaries. In fact, in order to link a static binary, you have to go to opendarwin and download the Csu package to build crt0.o. It's not included in any of the development tools. Apple warns that static binaries are likely to fail to operate in O/S version changes." From: http://www.haskell.org/pipermail/glasgow-haskell-users/2006-May/010211.html == Apache setup == - If you want nice URLs, install and enable mod_rewrite. The directory needs to have: AllowOverride Options Indexes FileInfo Limit == Install == - Build a tarball with everything that you need to put in the public web directory: $ cd site $ make installball-cgi or $ cd site $ make installball-fastcgi - Put the contents of the hope-installball directory of the tarball in the directory on the web server that you want to use for Hope. Note that there is a .htaccess file in there, which may not be seen with ls or normal shell globs. - Create database tables: $ ./createdb - After creating the database tables, createdb is no longer needed on the web server. - If you are using Halbum2, you need to create the directories referenced on the halbum2 settings page with the appropriate permissions.