Installation of CppCMS Framework
Note
This is old-stable version of CppCMS you are most likely looking for new version installation instructions
Requirements
We should divide the requirements into three categories:
- Mandatory -- you must follow them
- Recommended -- you generally should have them unless you have good reasons.
- Suggested -- you may have them, they provide some useful functionality.
You can find list of packages for Debian and Ubuntu there.
Mandatory
- POSIX1 Compatible Platforms: Linux, FreeBSD, OpenSolaris and Cygwin2 are tested.
Reasonable, standard complaint, C and C++ compilers that works smoothly with autotools.
GCC 3.4, 4.1, 4.2 and 4.3 (not recently) are tested. More compilers are planned to be tested.
- CgiCC library. Version 3.2.8 and above recommended.
- Boost libraries 1.33.1 or higher. 1.35 and above recommended.
- Python 2.x. It is used for compilation of templates to C++ code.
Recommended
FastCGI Library including C++ bindings.
FastCGI is the most popular communication protocol that is supported by vast majority of web servers.
One of the following web servers:
They are supported by CppCMS scripts that allow debug your applications easily.
Suggested
- OSSP mm shared memory allocation library. Provides process shared cache backend for mod prefork.
- Asio 1.0.0 and above or Boost 1.35.0 and above that includes Asio. Provides distributed cache and sessions backends.
- libgcrypt cryptography library. Provides encrypted cookies session backend.
- Sqlite3. It provides fast and simple DB for storage of sessions data.
GNU gettext -- it provides internationalization support.
It is not required for build, but it is required if you want to localize for your applications. It provides tools like xgettext. msgget and so on. CppCMS does not use its internationalization library.
Build
Getting sources
From Tarboll
You may download latest version from SF Download Page. For example cppcms-X.Y.Z.tar.gz
Untar them
tar -xzvf cppcms-X.Y.Z.tar.gz cd cppcms-X.Y.Z
From subversion
In addition to normal requirements you need subversion client and full autotools chain
svn co http://cppcms.svn.sourceforge.net/svnroot/cppcms/framework/branches/maintance_0_0_x/ cppcms
Then run:
cd cppcms ./autogen.sh ./autogen.sh
Configuration
Usually, configure script would recognize persistence of all libraries, and disable non mandatory parts if some of libraries are missing. However, you may disable them manually using following flags:
--disable-forkcache Disable shared memory cache --disable-fastcgi Disable fastcgi interface --disable-tcpcache Disable distributed cache system --disable-crypt Disable encrypted sessions backend --disable-sqlite Disable Sqlite sessions backend --enable-boostsuffix Specify custom suffix for boost libraries
So you run:
./configure make
If all finished without errors, run as "root":
make install
Building with Custom Boost Libraries
Generally, boost libraries are provided by your operating system, however, in some cases you may want to use special version of Boost that was build from the source.
Default Boost build does not create symbolic links to specific libraries so, you may find files like this:
/opt/include/boost-1_35/boost/regex.hpp /opt/lib/libboost_regex-gcc41-mt.so
Instead of
/usr/include/boost/regex.hpp /usr/lib/libboost_regex.so
In this case, you should specify --enable-boostsuffix
option in order to complete configuration and link correctly. In the above case it would be:
./configure CXXFLAGS=-I/opt/include/boost-1_35 \ LDFLAGS=-L/opt/lib --enable-boostsuffix=gcc41-mt
Don't forget to make sure that /opt/lib is in your LD_LIBRARY_PATH
.
Notes on binary packages
At this point CppCMS project does not provide binary packages for several reasons:
- This software works with wide range of different libraries and their different versions. Linux distribution packagers should decide how to build this framework and against which libraries.
- Some of libraries are not available from official repositories of all popular distributions.
- CppCMS project provided for developers that probably should deploy their application to different environment where, in most of cases, that library would be build for their own need with modules they need.
Some of POSIX/UNIX Features that are used:
- bash
- Berkeley and UNIX Sockets stack including poll(2)
- mmap, fork, sigaction
- Process shared pthread mutex/rwlock (optional, recommended)
/dev/urandom
- fcntl for file locking
Cygwin has many performance drawbacks, thus it is not recommended for production environment (as Windows at all
;-)
)