Maxwell Krohn edited this page Dec 12, 2011 · 15 revisions

How To Install

At present, OKWS services are built on top of the sfslite. To build OKWS services on your machine, you'll first need a reasonable installation of SFS, an installation of the OKWS core services and libraries, and finally, a development directory that allows you to build and link against the OKWS libraries. This document will step through the key points of this installation process, and will also detail some common configuration options.


Eventually, OKWS should not have any requirements aside from the SFS libraries. However, you will find that it works best if you first install the following libraries:

  • MySQL. Eventually, you'll probably want to use a database back-end for your web services, and we've built convenient wrapper libraries for the MySQL database libraries. OKWS should be compatible with versions 3.X and 4.X, although the latter is probably better tested. On Linux FC3 (and probably other Linux platforms too), you'll need both the ''mysql'' and the ''mysql-devel'' packages.
  • Dmalloc. You'll most likely run into memory leaks or memory corruptions with your software. SFS and OKWS have good support for Dmalloc.

Source and Build Directories

All packages in the OKWS chain support out-of-directory builds. This means that the source code, and the resulting object files can live in two different locations, even across two different filesystems. On a typical setup, one's source directories might be on an NFS mount, while the build directories will be on local disk (it's slow and a bad idea to be writing object files over NFS). Thus, we recommend making two directories: srcdir and builddir.

Installing SFS

If you already have SFS installed on your machine, you can probably skip this step. However, it might be useful to build SFS without optimization, and with use of the Dmalloc library, to assist in the debugging of your OKWS scripts. We offer a way to install a globally accessible SFS build on your machine without disrupting your current installation.

We're currently maintaining a version of the SFS libraries that can be built independent of the higher-level SFS applications. On some machines, building the full SFS distribution might take a while, so our sfslite distribution can be safely substituted for the full build.

From Anonymous GitHub

Clone our repo:

% git clone

This checks out a copy of the sfslite sources and places them in the sfslite directory on your machine. Change into your source directory and generate the appropriate configuration scripts.

% cd sfslite
% sh setup.gnu -f -i -s

Now you can build sfslite. To do this, first make a build directory to build the SFS object files. This might be a temporary directory, but it also might be useful to have the SFS objects around for future reference. Then, you're ready to configure and build:

% cd <builddir>
% mkdir sfslite-1.2
% cd sfslite-1.2
% <srcdir>/sfslite/cfg --with-mode=shdbg
% gmake

In this example, we're building sfslite in "shdbg" mode (shared debug mode). Shared debug mode will automatically link against the Dmalloc library, will use shared linking, and will not optimize. It will also set the //build-tag// equal to shdbg. This tag determines installation directories as follows:

Library Directory Binary Directory Include Directory
/usr/local/lib/sfslite/build-tag /usr/local/lib/sfslite/build-tag /usr/local/include/sfslite/build-tag

We could have also given the configure script (cfg) the mode lite, which has optimization -O2, no Dmalloc linking, and sets the build-tag to lite.

Finally, install sfslite:

% su root
# gmake install

Installing OKWS

Clone from github:

% git clone

Now, build a configuration script as usual:

% cd okws
% sh setup.gnu -f -i -s

Next, switch to your build directory, to configure and build OKWS:

% cd <builddir>
% mkdir okws
% cd okws
% <srcdir>/okws/cfg --with-mode=shdbg
% gmake

Again, we're building with debug mode, which sets the same debugging option as above, looks for the SFS build with the same shdbg tag, and finally sets the build tag for OKWS to be shdbg. You can specify custom build tags with the --with-tag=<tag> option. You can link against specific installed builds of SFS with the --with-sfstag=<tag> option. There's a host of build options available, which you can access with ./configure --help. Also note that setting the DEBUG, CC, and CXX environment variables prior to running configure will set compiler debug flags, the C compiler, and the C++ compiler, respectively. Also note that cfg is a lite script that writes your configure options to a file in your build directory, and then calls configure as normal. This way, if you ever need to reconfigure, just run ./cfg from your OKWS build directory.

Finally, you can install your OKWS libraries, headers and executables:

% su root
# gmake install

As before, this will yield the following install configuration:

Library Directory Binary Directory Include Directory
/usr/local/lib/okws/build-tag /usr/local/lib/okws/build-tag /usr/local/include/okws/build-tag


Also, you'll need to setup your log directories so that your logger can write there. This of course depends on where your log files are, and what permissions your logger runs with. See ''okws_config'' for more details. For our setup, we would do:

% mkdir /var/okws/log
% chown www /var/okws/log
% chmod 744 /var/okws/log