Aug 202010

Here is a simple example of a hello world program for FastCGI written in C. Before you can compile this, you will need to install the FastCGI devkit. At the time of writing the latest version is available from

extract, compile and install fcgi-current.tar.gz

$ tar xvzf fcgi-current.tar.gz
$ cd  fcgi-2.x.x/
$ ./configure
$ make
$ sudo make install

the c code

#include <fcgi_stdio.h>
int main( int argc, char *argv[] )
   while( FCGI_Accept() >= 0 ) {
      printf( "Content-Type: text/plain\n\n" );
      printf( "Hello world in C\n" );
   return 0;

Continue reading »

Mar 262010

This tutorial will covering common feature in git repository

  • commiting via ssh
  • Enable gitweb for web access
  • cloning anonymously using the Git protocol

Install git, git-daemon

# yum -y install git git-daemon gitweb

Create a git user/group

# useradd -U -d /var/cache/git -s /usr/libexec/git-core/git-shell git

Make sure the permissions of the directory are correct

# cd /var/cache
# chown -R git:git git
# chmod 755 git

We’ll be using SSH keys for authenication, so collect the public keys of all the users who need commit access. Then, put the public keys into the right place

# cd /var/cache/git
# mkdir .ssh
# chmod 700 .ssh
# touch .ssh/authorized_keys
# chmod 600 .ssh/authorized_keys
(Put the public keys into authorized_keys, one per line)
# chown -R git:git .ssh/

Continue reading »