~jeffpc/blahgd

An efficient blahging server with LaTeX-like syntax

#23 RSS feed of all comments

~jeffpc filed ticket on blahgd todo

10 days ago

#8 Admin web UI

~jeffpc commented on blahgd todo

a month ago
CMake variables
===============

	CMAKE_INSTALL_PREFIX

In addition to standard CMake variables, the following can be set to tweak
blahgd's behavior:

	DEFAULT_SCGI_PORT	- default port to listen on for SCGI requests

	DEFAULT_HTML_INDEX_STORIES
				- default number of posts per page (index,
				  archive)
	DEFAULT_FEED_INDEX_STORIES
				- default number of posts per page (Atom/RSS
				  feeds)

	DEFAULT_COMMENT_MAX_THINK
				- default maximum number of seconds of think
				  time after which a submission is
				  considered a spam
	DEFAULT_COMMENT_MIN_THINK
				- default minimum number of seconds of think
				  time before which a submission is
				  considered a spam

	DEFAULT_DATA_DIR	- default path to the data directory
	DEFAULT_THEME_DIR	- default path to the theme directory

	VAR_MAX_SCOPES		- maximum number of internal scopes
	VAR_NAME_MAXLEN		- maximum length of a variable name

	COND_STACK_DEPTH	- template engine function stack size

	DEFAULT_TAGCLOUD_MIN_SIZE
				- default min font size of tag cloud entries
	DEFAULT_TAGCLOUD_MAX_SIZE
				- default max font size of tag cloud entries

	PREVIEW_SECRET		- key used to previewing unpublished posts


Dependencies
============

To build blahgd you must have:

  - gcc/clang or other C99 compiler with compatible arguments
  - flex & bison
  - libjeffpc (http://hg.31bits.net/libjeffpc/)

Building and Installing
=======================

$ cmake . -DCMAKE_INSTALL_PREFIX=/prefix
$ make
$ make install

This will install the binaries under the specified prefix.

Note: If libjeffpc is not installed in a location that's part of the
compiler and linker search path, you'll have to give cmake a hint where to
find it.  You do this by defining these as necessary:

  - WITH_JEFFPC_LIB=x      - directory containing libjeffpc.so
  - WITH_JEFFPC_INCLUDES=x - directory containing jeffpc/jeffpc.h
  - WITH_JEFFPC=x          - same as setting WITH_JEFFPC_LIB=x/lib and
                             WITH_JEFFPC_INCLUDES=x/include

For example:

$ cmake . -DWITH_JEFFPC=/opt/jeffpc <...other cmake args...>


Running
=======

You can start the blahg daemon (blahgd):

$ ./blahgd

At this point, blahgd is listening on port 2014 for SCGI connections.  Now,
you need to configure your webserver to pass requests to blahgd.  For example,
for nginx, use a config stanza similar to:


        server {
                listen       80;
                server_name  blahg.example.com;

                location / {
                        include scgi_params;
                        scgi_pass localhost:2014;
                }
        }

The scgi_params file should include:

scgi_param  REQUEST_METHOD     $request_method;
scgi_param  REQUEST_URI        $request_uri;
scgi_param  QUERY_STRING       $query_string;
scgi_param  CONTENT_TYPE       $content_type;

scgi_param  DOCUMENT_URI       $document_uri;
scgi_param  DOCUMENT_ROOT      $document_root;
scgi_param  SCGI               1;
scgi_param  SERVER_PROTOCOL    $server_protocol;
scgi_param  HTTPS              $https if_not_empty;

scgi_param  REMOTE_ADDR        $remote_addr;
scgi_param  REMOTE_PORT        $remote_port;
scgi_param  SERVER_PORT        $server_port;
scgi_param  SERVER_NAME        $server_name;