Home  /  RSS  /  RSS Comments  /  Enter

Building CppCMS

5/19/08, by artyom ; Posted in: Progress; 6 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.

Comments

tiennou, at 8/30/09, 1:42 PM

Hi artyom !

I was very thrilled when I read all your posts about cppcms .. I have been looking for this kind of framework for some time, and it finally appears that something exists !

Unfortunately, I cannot manage to get it to work on my Ubuntu Jaunty box (x86_64). I always end up with some error looking like :

checking fastcgi/fcgiapp.h  usability... no
checking fastcgi/fcgiapp.h  presence... no
checking for fastcgi/fcgiapp.h ... no

checking asio.hpp presence... no
configure: WARNING: asio.hpp: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: asio.hpp: proceeding with the compiler's result
checking for asio.hpp... yes


checking for main in -lintl... no
checking for main in -lboost_regex... no
checking for main in -lboost_regex-gcc-mt... no
boost::regex not found

This happens after the autogen.sh, during the configure. More precisely, when trying to build the templates or the framework ..

Any idea is very welcomed !

I have installed the following packages : libboost-date-time1.37-dev install libboost-date-time1.37.0 install libboost-filesystem1.37-dev install libboost-filesystem1.37.0 install libboost-graph1.37-dev install libboost-graph1.37.0 install libboost-iostreams1.37-dev install libboost-iostreams1.37.0 install libboost-program-options1.37-dev install libboost-program-options1.37.0 install libboost-python1.37-dev install libboost-python1.37.0 install libboost-regex1.37-dev install libboost-regex1.37.0 install libboost-serialization1.37-dev install libboost-serialization1.37.0 install libboost-signals1.37-dev install libboost-signals1.37.0 install libboost-system1.37-dev install libboost-system1.37.0 install libboost-test1.37-dev install libboost-test1.37.0 install libboost-thread1.37-dev install libboost-thread1.37.0 install libboost-wave1.37-dev install libboost-wave1.37.0 install libboost1.37-dev install libboost1.37-doc install libcgicc5 install libcgicc5-dev install libfcgi-dev install libfcgi0ldbl install libsqlite3-0 install libsqlite3-dev install libdbi0 install libdbi0-dev install libdbd-pgsql install libmm-dev install libmm14 install

tiennou, at 8/30/09, 2:05 PM

Actually i was just needing : --enable-boostsuffix=mt .. sorry :$

artyom, at 8/30/09, 2:18 PM

First of all use latest versions version of CppCMS documentation on http://cppcms.sourceforge.net/, and installation instructions at
http://cppcms.sourceforge.net/wikipp/en/page/install_framework

Note: templates are already part of framework and not independent library.

Also read section: "Building with Custom Boost Libraries" at the installation page. Because as I can see, Ubuntu, do not create default libraries as /usr/lib/libboost_regex.so but adds "mt" suffix, so if boost libraries are not found, use ./configure option boostsuffix as described in this section.

Also, I would recommend to rather use latest released tarbolls, over using svn trunk version that maybe sometimes unstable or even broken.

Good luck. ;)

Si, at 12/30/11, 1:45 PM

I decided to give this a shot, but seems to have come unstuck. System is Debian Squeeze 6.0.3:

./configure --enable-boostsuffix=mt
[SNIP]
Useful BOOST_TYPEOF... ok
checking fastcgi/fcgiapp.h  usability... no
checking fastcgi/fcgiapp.h  presence... no
checking for fastcgi/fcgiapp.h ... no
checking asio.hpp usability... no
checking asio.hpp presence... no
checking for asio.hpp... no
checking boost/asio.hpp usability... yes
checking boost/asio.hpp presence... yes
checking for boost/asio.hpp... yes
checking for main in -lcgicc... no
cgicc not found

CGICC is installed:

# dpkg -la |grep cgicc
ii  libcgicc5                             3.2.9-1                         A     C++ class library for writing CGI applications
ii  libcgicc5-dev                         3.2.9-1                         A C++ 

class library for writing CGI applications

Any ideas how to work around this?

artyom, at 12/30/11, 3:59 PM

The version you are trying to use is old one and not recommended.

Most of users use CppCMS 1.x.x

Read: http://art-blog.no-ip.info/wikipp/en/page/main

And: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x

Si, at 1/2/12, 11:25 AM

Thank-you artyom. S

Add Comment:

 
 the email would not displayed
 

You can write your messages using Markdown syntax.

You must enable JavaScript in order to post comments.

Pages

Categories