Home  /  RSS  /  RSS Comments  /  Project Site  /  Enter

Building CppCMS

19/05/08, by artyom ; Posted in: Progress; 0 comments

I had not published any official alpha or beta release yet, however, anyone who wants to use it can install the framework quite easily (I think).

There are three major parts of the framework:

  1. Templates support module – libtmpl or templates subproject.
  2. C++ Wrapper for dbi DB access library – libdbixx or dbixx subproject
  3. Base framework – libcppcms or framework subproject.
  4. This blog – an example how to use CppCMS or cms subproject

Thus in order to install the system we need to do following:

Requirement

These are the requirements for building CppCMS

General requirements

  1. POSIX compatible environment – modern Linux distribution or Cygwin for Windows.
  2. C and C++ compilers, usually gcc.
  3. GNU Autotools – automake, autoconf, libtool
  4. Boost Libraries: regex, iostreams, signals
  5. Subversion – for getting the code from repository.

Framework

  1. CgiCC libraries
  2. Optional: FastCGI libraries including C++ bindings: fcgi++
    you may use scgi if you don’t have them.
  3. Optional: OSSP mm library (libmm)
    If you want to use "modprefork" and have cache.

Templates Engine

  1. GNU gettext – support of translations
  2. Python – for templates compilation

DbiXX SQL Layer

LibDBI – database access library (version 0.8 and higher) and of these

This Blog

  1. LibCURL for the blog software itself – the framework do not require this.
  2. Any of following libdbi drivers: mysql, postgresql, sqlite3
  3. Optional: Lighttpd web server for testing. You can use any FastCGI enabled web server as well, but I hadn’t written pre-configured scripts for it.
  4. Optional: If you want to add LaTeX equations to the blog, you need to install latex and dvipng packages.

If you use Debian you can grab all the libraries using simple command:

apt-get install libdbi0-dev libfcgi-dev \
   libcgicc1-dev libboost-regex-dev libboost-signals-dev \
   libboost-iostreams-dev libcurl3-dev libmm-dev

And one of or all of these

apt-get install libdbd-mysql libdbd-sqlite3 \
   libdbd-pgsql

Note: if you use Debian Etch or Ubuntu Gutsy then you may have old version of libdbi that will not build with dbixx layer. Thus you may need to compile/backport it from the source, see notes above.

Installation

Grab following subprojects of cppcms framework

svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/templates/trunk/ templates
svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/dbixx/trunk/ dbixx
svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/framework/trunk/ framework
svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/cms/trunk/ blog

Build and install templates, dbixx and framework subprojects:

$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
# make install

Now you can build the blog itself as above, just you should not run make install'

Note for cygwin users: Instead of ordinary "configure" You need to run

CXXFLAGS=-I/usr/include/boost-1_33_1 ./configure

Setting up the CMS

Go to the root folder of cms project and setup database

MySQL

Create a data base let’s say "cppcms". Then run following commands to setup correct DB tables;

mysql -u user --password=yoursecret <data-mysql.sql

Sqlite3

Create folder "db" and create your database running

sqlite3 ./db/cppcms.db <data-sqlite.sql

Edit config-local.txt file and update the database section with correct db engine and parameters.

Make sure that "blog.configure=1" is in your file

Run

./run_lighttpd

Go to URL "localhost:8080/blog" and setup blog parameters you need like username, name etc.

Stop the server by pressing enter, set blog.configure=0 and start it again (./run_lighttpd).

Go to the above URL and enjoy your C++ Blog

Debian Etch Notes

Backporting of libdbi on Debian Etch can be done quite easily:

  1. Download sources packages from lenny or sid repository:

    apt-get soruce libdbi libdbi-drivers
    
  2. Go to libdbi directory and build libdbi:

    dpkg-buildpackage -rfakeroot
    
  3. Install two "debs" you got
  4. Now go to libdbi-drivers directory and edit following files:

    debian/control: remove dependency of libpq-dev (>=8.3) leave just libpq-dev. Change version of debhelper dependency from 6 to 5
    debian/compat: change 6 to 5

  5. Run in libdbi-drivers folder:

    dpkg-buildpackage -rfakeroot

  6. Install libdbd-XYZ packages you need – probably you need mysql or sqlite3.

If dpkg-buildpackage tells that you need more dependencies – install them.

You can send a trackback to following url:

Add Comment:

Name:
E-Mail:
Site:

You can write your messages using Markdown syntax.

You must enable JavaScript in order to post comments.

Pages

Categories

Development

Powered By

3rd Party