Building CppCMS
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:
- Templates support module -- libtmpl or templates subproject.
- C++ Wrapper for dbi DB access library -- libdbixx or dbixx subproject
- Base framework -- libcppcms or framework subproject.
- 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
- POSIX compatible environment -- modern Linux distribution or Cygwin for Windows.
- C and C++ compilers, usually gcc.
- GNU Autotools -- automake, autoconf, libtool
- Boost Libraries: regex, iostreams, signals
- Subversion -- for getting the code from repository.
Framework
- CgiCC libraries
- Optional: FastCGI libraries including C++ bindings: fcgi++
you may use scgi if you don't have them. - Optional: OSSP mm library (libmm)
If you want to use "modprefork" and have cache.
Templates Engine
- GNU gettext -- support of translations
- Python -- for templates compilation
DbiXX SQL Layer
LibDBI -- database access library (version 0.8 and higher) and of these
This Blog
- LibCURL for the blog software itself -- the framework do not require this.
- Any of following libdbi drivers: mysql, postgresql, sqlite3
- 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.
- 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:
Download sources packages from lenny or sid repository:
apt-get soruce libdbi libdbi-drivers
Go to libdbi directory and build libdbi:
dpkg-buildpackage -rfakeroot
- Install two "debs" you got
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 5Run in libdbi-drivers folder:
dpkg-buildpackage -rfakeroot
- Install libdbd-XYZ packages you need -- probably you need mysql or sqlite3.
If dpkg-buildpackage tells that you need more dependencies -- install them.
Comments
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 :
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
Actually i was just needing : --enable-boostsuffix=mt .. sorry :$
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
optionboostsuffix
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. ;)
I decided to give this a shot, but seems to have come unstuck. System is Debian Squeeze 6.0.3:
CGICC is installed:
class library for writing CGI applications
Any ideas how to work around this?
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
Thank-you artyom. S
Add Comment:
You must enable JavaScript in order to post comments.