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-driversGo 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.
You can send a trackback to following url:
Add Comment:
You can write your messages using Markdown syntax.
You must enable JavaScript in order to post comments.