openflax-2003.0927 README ------------------------- OpenFlax is an experimental open-source web server written in Erlang. For more information about OpenFlax, see the doc/ subdirectory. Installation ------------ Unpack the archive so that the openflax-<> directory is in your Erlang lib directory. To recompile the binaries, if necessary: from the command prompt, in the openflax-<> directory, type erlc -o ebin/openflax src/openflax/*.erl erlc -o ebin/openflax/http src/openflax/http/*.erl Creating a Configuration File ----------------------------- In order to run OpenFlax, you must first create a configuration file that tells it how to behave. Make a copy of the file doc/conf/sample.conf and modify it to reflect your desired configuration. You can also use the openflax.tool.installer module from the openflax_mod application to walk you through creating your configuration file. Manually Starting and Stopping ------------------------------ To start OpenFlax, type the following from the shell or command prompt: erl -run openflax.app start /where/you/put/your.conf To stop the web server, type 'q().' (without quotes), then press Enter. Starting at Boot Time --------------------- You may start the web server on a FreeBSD system every time it boots up by following these steps: - Create a user named www and give them a shell that can understand the '-c' option (e.g. /bin/sh). - Copy the file script/openflax into the /usr/local/bin directory. You may also want to edit it to change the mnesia database directory. (This directory should be owned by the user www and should not be publicly readable.) - Copy the file script/openflax.sh into the /usr/local/etc/rc.d directory. Note that stopping OpenFlax with openflax.sh requires that 'killall' is installed on your system, and will stop all instances of the Erlang/OTP runtime ('beam') running as www - so you should probably run only one. After following these steps, the result will be that, upon boot, 'openflax.sh start' will be executed, which will su to the www user and start the script /usr/local/bin/openflax. All of the supplied scripts are written for FreeBSD 4.8 but they should be fairly generally applicable to Unix-like systems.