Indefero

Rework-of-installationinstructions


Table of Contents

Work In Progress: Draft of new Installation Instructions

Draft and Work In progress!!!!

This is a draft version of updated installation instructions. Currently it is not nearly usable for use, it is intended as a base for discussions and evaluation.

This is work in progress and NOT suitable for use

Indefero

Indefero is a project hosting server software, inspired by Google Code. Indefero supports multiple projects where each project having its own wiki, issues, source repository and download-area. Indefero supports Git, Subversion, Monotone and Mercurial.

This guide applies to version 1.0 of Indefero, released XXXX.

Prerequisites

Indefero needs the following prerequisites to be in place:

  • PHP Version 5.2.4 or later.
  • PEAR, the PHP standard library.
  • pecl-fileinfo, libmagic bindings for PHP.
  • Webserver with PHP as module or fastcgi.
  • Database (MySQL and PostgreSQL are supported, SQLite is supported but not recommended for deployment)
  • PHP Database Interface module.
  • Pluf (included in the instructions).
  • Python < 3.0 for the access control through ssh.

Databases and Interface Modules

Indefero supports MySQl, PostgreSQL databases for production and SQLite for testing purposes using the appropriate PHP interface module; php5-mysql, php5-pgsql, and php5-sqlite.

You will need to be able to create an Indefero database and to configure the system with a user with permissions to read and make changes in that database.

The reason SQLite is not suitable for production are limitations in Pluf as SQLite does not support all the ALTER SQL commands and they are not emulated in Pluf.

Installation Instructions for Linux

This section will guide you through the preparation of PHP and installation of Pluf and Indefero. Pluf is not part of Indefero but is the framework used by Indefero. It is included as the process of installing Pluf integrates with the process of installing Indefero.

Directory Layout used within this instruction

For safety reasons it is recommended to minimize the number of files located in the web server document root, which is taken in consideration in this instruction.

The following layout will be assumed during the installation. You are free to use another one and have to change the instructions accordingly.

The Web Server document root is assumed to be located at:

/var/www

The resulting installation of Pluf will be located in:

/home/www/pluf/

The resulting installation of Indefero will be located in:

/home/www/indefero

Source Code and tar-files is expected to be downloaded into a download directory in the home directory:

/home/allan/downloads

Root-permissions and Shell Commands

The main part of the installation takes place in a command shell. Please refer to your Linux distro for information about how to start a shell.

To indicate that there is a command to be entered at the shell prompt we use a $-sign:

$ mkdir indefero

This indicates that you shall enter the command

mkdir indefero

at the shell prompt that is normally a $-sign. The $-sign shall not be entered.

Throughout this guide we will use sudo when root permissions is required. In some distros sudo is not installed and those command shall be run as root instead. Refer to your Linux distro for help on root access.

Download software and prepare the installation

Download Pluf

Download latest release of Pluf into the downloads directory

Unpack it into the target directory.

$ cd /home/www
$ unzip ~/downloads/pluf-master.zip

Pluf is now located in a subdirectory named pluf-master, this should be renamed to pluf.

$ mv pluf-master pluf

Pluf files is now located in:

/home/www/pluf

Download Indefero

Next step is to download the indefero source from Indefero Downloads.

Unpack it into the release directory and rename it properly:

$ cd /home/www
$ unzip ~/downloads/indefero-1.0.zip
$ mv indefero-1.0 indefero

Indefero files is now located in:

/home/www/indefero/

To make the web-server find them you will need to create some symbolic links:

$ ln -s /home/www/indefero/www/index.php /var/www/index.php
$ ln -s /home/www/indefero/www/media /var/www/media

Preparing PHP and dependencies to PHP standard libraries

The PHP standard library is PEAR and must be installed and upgraded as both Pluf and Indefero relies on it. Verify with your Linux distro how to install PEAR if not already in place.

Second is to upgrade PEAR to latest version:

$ sudo pear upgrade-all

Third is to install mail agents. Note the command line option --alldeps, this is important as it tells PHP to install all dependencies needed.

$ sudo pear install --alldeps Mail
$ sudo pear install --alldeps Mail_mime

Preparing Pluf

This is an easy step - there is nothing to setup in Pluf.

Preparing InDefero

First we shall create a configuration file and configure it to suite your particular the system.

$ cd /home/www/indefero/
$ cp src/IDF/conf/idf.php-dist src/IDF/conf/idf.php

Open the idf.php in your favourite editor - mine is vi. Go through the configuration options in the file, and yes, there are a lot of them.

Second we shall create a directory-configuration file and configure it to suite your particular the system.

$ cp src/IDF/conf/path.php-dist src/IDF/conf/path.php

Edit the path.php to fit your system. It shall work out of the box if the directory layout in this guide is followed.

Creating indefero tables

The database and tables needed for InDefero is created using a pluf-script.

First thing to do is to edit the idf.php and setup the database. The procedure expects the following to be in place:

  • A database to be used for the installation
  • A user granted permission to make changes in the database (create tables, object etc)
  • The password for the user

We recommend the use of a dedicated indefero or web user only granted the needed permissions.

Secondly we performs a dry-run to verify that we will be able to create the database and tables.

$ cd /home/www/indefero/src
$ php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d -u

Assuming everything went well we continue with actually creating the tables:

$ php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d

Creating a boot-strap-script for InDefero

It is now time to initiate InDefero with a admin-user. This is made by creating a boot-strap script that is executed once and then removed. Place the script in your home directory or somewhere private - you will not want this file accessed from the internet.

The script skeleton needs to be modified to match the admin users name and other details. There are some restrictions in the script:

  • The last name of the administrator is mandatory
  • The login must be lower case
  • The password is salted/hashed in the database, there will be no copy in clear text and it cannot be retrieved.

Copy and edit this skeleton:

<?php
require '/home/www/indefero/src/IDF/conf/path.php';
require 'Pluf.php';
Pluf::start('/home/www/indefero/src/IDF/conf/idf.php');
Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));

$user = new Pluf_User();
$user->first_name = 'John';
$user->last_name = 'Doe'; // Required!
$user->login = 'doe'; // must be lowercase!
$user->email = 'doe@example.com';
$user->password = 'yourpassword'; // the password is salted/hashed 
                              // in the database, so do not worry :)
$user->administrator = true;
$user->active = true;
$user->create();
print "Bootstrap ok\n";
?>

Run the script and remove it:

$ php bootstrap_indefero.php
$ rm bootstrap_indefero.php

Test the installation

It is now time to test InDefero. Surf into the system using the following URL: http://yourdomain.com/index.php and the admin-user from the boot-strap script as user.

You shall be able to create projects!

Created: 11 years 3 months ago
by Natalie Adams

Page rendered in 0.04354s using 24 queries.