Wikipp is a high performance wiki engine based on CppCMS technology |
|
**BIG FAT WARNING:** |
|
> This tutorial is not up-to-date, there is a new version of wikipp written for CppCMS 1.0.0. Use it. |
> |
> You can get its sources from subversion from |
> svn using |
> svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/wikipp/branches/for_cppcms_v100 |
|
|
|
## Requirements |
|
Before you install WikiPP you need to install |
|
- [CppCMS Framework](/wikipp/en/page/install_framework) |
- [DbiXX Library](/wikipp/en/page/install_dbixx) |
- [CppCMS Framework](wikipp/en/page/cppcms_1x_build) - version 0.999.0 and above |
- [CppDB Library](/sql/cppdb) |
- [Discount Markdown Library](http://www.pell.portland.or.us/~orc/Code/discount/) |
- [Syntax Highligher](http://code.google.com/p/syntaxhighlighter/) --- recommended but not mandatory. |
|
## Installation of WikiPP |
|
Download wikipp-X.Y.Z.tar.gz and extract it: |
|
tar -xzf wikipp-X.Y.Z.tar.gz |
cd wikipp-X.Y.Z |
|
If you are using trunk version: |
|
svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/wikipp/trunk wikipp |
cd wikipp |
|
and then create configuration scripts: |
and then create a build directory |
|
cd wikipp |
./autogen.sh |
./autogen.sh |
mkdir build |
|
Configure the wiki build system |
|
cmake .. |
|
Or of you want to install to ordinary `/usr` path instead |
of `/usr/local` |
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr .. |
|
Then run |
|
./configure |
make |
|
And as super user |
|
make install |
|
## Configuration of Wiki |
|
I assume that you had installed wikipp to /usr/local directory (default for configure script). Otherwise, you should update absolute paths given in this documentation |
|
### Database |
|
- If you use MySQL (recommended): |
You can find DB configuration scripts under /usr/local/share/wikipp/sql directory, use them to create a database |
|
- If you use MySQL: |
|
First of all, create database, let's call it "wikipp". |
|
create database wikipp; |
|
Then create all required tables running: |
|
mysql -u username --password=secret wikipp </usr/local/share/wikipp/mysql.sql |
mysql -u username --password=secret wikipp <mysql.sql |
|
- If you use Sqlite3 |
|
Create database, and make it accessible to process that would run wikipp: |
|
sqlite3 /var/wikipp/wikipp.db </usr/local/share/wikipp/sqlite3.sql |
sqlite3 /var/wikipp/wikipp.db <sqlite3.sql |
|
Make sure that /var/wikipp/wikipp.db is writable by the web server. |
|
### WikiPP configuration |
|
First create your new, unique private key for session management. Run |
|
cppcms_make_key |
|
Edit /usr/local/etc/wikipp/config.txt and update `session.cookies_key` with value you get. |
|
**REMEMBER THIS IS YOUR PRIVATE KEY, KEEP IT IN SECRET** |
|
Let's assume you want your application to run at "/wiki" url and put all media (static) files at "/media". Also, let's assume that your WWW server document root is /var/www/html |
|
So, let's create our media directory: |
|
mkdir /var/www/html/media |
cp /usr/local/share/wikipp/style*.css /var/www/html/media |
|
Now let's edit our WikiPP configuration file and set: |
|
wikipp.script = "/wiki" |
wikipp.media = "/media" |
|
If you have Syntax Highlighter installed, for example in /var/www/html/shared/sh |
|
Then edit line: |
- If you use PostgreSQL |
|
wikipp.syntax_highlighter = "/shared/sh" |
createdb wikipp |
psql wikipp <postgresql.sql |
|
Otherwise **comment** this line to disable it. |
### WikiPP configuration |
|
# wikipp.syntax_highlighter="/templates/sh" |
Take a sample configuration file placed under /usr/local/shared/wikipp/sample_config.js create a copy and edit it. |
|
We would configure our application to be started by |
the web server thus -- comment out `server.socket` line --- web server provides it for you. |
1. First create your new, unique private key for session management. Run |
|
Edit `dbixx.driver` and select appropriate database: "sqlite3" or "mysql" |
cppcms_make_key --hmac sha1 --cbc aes |
|
Configure database parameters like: username and password for MySQL or sqlite3.sqlite3_dbdir to the directory where the database file is located. |
Or if your cppcms library was build without libgcrypt and openssl: |
|
Make sure that `locale.dir` and `templates.dirs` points to correct path: |
cppcms_make_key --hmac sha1 |
|
locale.dir="/usr/local/share/locale" |
templates.dirs = { "/usr/local/lib/wikipp" } |
Update the private keys in the configuration file. |
|
## Web Server Configuration |
**REMEMBER THESE ARE YOUR PRIVATE KEYS, KEEP THEM IN SECRET** |
|
### Lighttpd |
2. Configure connection string under `wikipp.connection_string`. Don't forget to define `@pool_size` connection string property to enable connection pooling. |
|
Edit you lighttpd configuration: |
Refer to [CppDB manual](http://cppcms.com/sql/cppdb) for exact options. |
|
Enable fastcgi |
3. Configure your web server according [this manual](/wikipp/en/page/cppcms_1x_tut_web_server_config). |
|
server.modules += ( "mod_fastcgi" ) |
Note, the wikipp media files installed into `/usr/local/share/wikipp/media`. Make sure that you have configured |
valid alias to this location and the `wikipp.media` |
as correct value assigned according to the location |
of the files relatively the the web servers |
document root. |
|
Now let's configure our wiki application: |
4. Make sure that `locale.dir` and `templates.dirs` points to correct path: |
|
fastcgi.server = ( |
"/wiki" => |
(( |
"bin-path" => "/usr/local/sbin/wikipp -c /usr/local/etc/wikipp/config.txt", |
"socket" => "/tmp/wikipp.socket", |
"max-procs" => 1, |
"check-local" => "disable" |
)) |
) |
"localization" : { |
"messages" : { |
"paths" : [ "/usr/local/share/locale"] |
|
Short description: |
And you have correct path to location of the t |
templates directory |
|
1. "/wiki" is the location of our web service |
2. "bin-path" shows the application that should be started. |
3. "max-procs" -- very important -- always set to 1, unless you use distributed cache system. |
4. "check-local" -- disable checking if actual file exists in the specific document root. It is applicable for PHP scripts not our FastCGI application. |
"views" : { |
"paths" : [ "/usr/local/lib/wikipp" ], |
|
### Testing |
|
Now restart you web server and go to "http://your.host.com/wiki" and start working |