Compiling OSSEC for a Binary Installation

Warning

This installation method should be revisited, it may not work.

In the past OSSEC was often compiled on each system it was installed on. This is not the only method of installation however. OSSEC can be compiled on one system and copied to a destination system. This method of installation still requires GNU make on the target system, but not the compilers or development packages.

Note

OSSEC has very limited cross compiling facilities. Windows binaries can be built on Linux systems, but binaries for other systems should be built on a system of the same OS and CPU platform.

Compiling OSSEC for install on a second server

First download the OSSEC package corresponding to the version you want to install and extract it on the build system.

Enter in the source directory of the downloaded package, and configure OSSEC to build the agent version. The make commands should compile the correct binaries.

$ cd ossec-hids-*/src
$ make TARGET=agent

Modify ossec-hids-*/etc/preloaded-vars.conf to set BINARY_INSTALL to yes.

$ echo "USER_BINARYINSTALL=\"y\"" >> ossec-hids*/etc/preloaded-vars.conf

Finally create an OSSEC package.

$ tar -cvf ossec-binary.tar ossec-hids*

Installation of the binary OSSEC package

On the target system (that does not have a C compiler) download your ossec-binary.tar created in the steps above.

Complete the installation by unarchiving the binary package and running sudo ./install.sh.

$ tar xfv ossec-binary.tar
$ cd ossec-*
$ sudo ./install.sh

After following the installation prompts the install will be complete.