Total Pageviews

Tuesday, 18 August 2015

CppBlog

CppBlog - CppCMS Powered Blog Engine

CppBlog is a high performance blog engine based on CppCMS technology

Requirements

Before you install CppBlog you need to install
Optionally if you want to embed LaTeX formulas you may need latex and dvigif programs in runtime.

Installation of CppBlog

Download cppblog-X.Y.Z.tar.bz2 and extract it:
  1. tar -xjvf cppblog-X.Y.Z.tar.gz  
  2. cd cppblog-X.Y.Z  
If you are using trunk version:
  1. svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/blog/trunk cppblog  
  2. cd cppblog  
and then create a build directory
  1. mkdir build  
Configure the cppblog build system
  1. cmake ..  
Or of you want to install to ordinary /usr path instead of /usr/local
  1. cmake -DCMAKE_INSTALL_PREFIX=/usr ..  
Then run
  1. make  
And as super user
  1. make install  

Configuration of the blog

I assume that you had installed the blog to /usr/local directory (default for configure script). Otherwise, you should update absolute paths given in this documentation

Database

You can find DB configuration scripts under /usr/local/share/cppblog/sql directory, use them to create a database
  • If you use MySQL:
    First of all, create database, let's call it "blog".
    1. create database blog;  
    2. create user 'username'@'localhost' identified by 'password';  
    3. grant all privileges on blog.* to 'username'@'localhost';  
    Then create all required tables running:
    1. mysql -u username --password=secret blog <mysql.sql  
  • If you use Sqlite3
    Create a database:
    1. sqlite3 /var/blog/blog.db <sqlite3.sql  
    Make sure that /var/blog/ and /var/blog/blog.db is writable by the web server.
  • If you use PostgreSQL
    1. createdb blog  
    2. psql blog <postgresql.sql  

CppBlog configuration

Take a sample configuration file placed under /usr/local/share/cppblog/sample_config.js create a copy and edit it.
  1. First create your new, unique private key for session management. Run
    1. cppcms_make_key --hmac sha1   
    Update the private keys in the configuration file.
    REMEMBER THESE ARE YOUR PRIVATE KEYS, KEEP THEM IN SECRET
  2. Configure connection string under blog.connection_string. Don't forget to define @pool_size connection string property to enable connection pooling.
    Refer to CppDB manual for exact options.
  3. Configure your web server according this manual.
    Note, the cppblog media files installed into /usr/local/share/cppblog/media. Make sure that you have configured valid alias to this location and the blog.media has correct value assigned according to the location of the files relatively the the web servers document root.
  4. Make sure that localization.messages.messages and views.paths points to correct path:
    Locale dictionaries:
    1. "localization" : {  
    2.   "messages" : {  
    3.      "messages" : [ "/usr/local/share/locale"]  
    Views path:
    1. "views" : {  
    2.    "paths" : [ "/usr/local/lib/cppblog" ],  
  5. Make sure you set the correct value for blog.host configuration option. It is important for correct RSS generation.

Customization

You can select one of the two views "orangesky" or "contended". You can select it by setting views.default_skin option.
The blog language can be selected by setting required value for localization.locales option.

First Run

Once you had setup the blog of first access you will be asked to create a user and setup a password, once you configured them, login。

FROM  http://cppcms.com/wikipp/en/page/install_cppblog

源码下载地址:http://sourceforge.net/projects/cppcms/files/cppblog/