Indefero

Installation-on-FreeBSD


Table of Contents

Installation on FreeBSD 7.2

Introduction

Here are some "random" notes I made while installing indefero on FreeBSD 7.2. Please note, that I'm not the typical user of it, since I want to handle all the git stuff and permissions through git and not through indefero. My goal is to use it just as a browser of already exiting git repositories and for lightweight code review.

Having you warned, let's go ahead.

Install indefero

cd /usr/ports/devel/pear-PEAR_PackageFileManager

make install clean


cd /usr/ports/archivers/unzip 

make install clean

pear upgrade-all
pear install --alldeps Mail
pear install --alldeps Mail_mime  

 

mkdir -p /home/www
 

get the packages and put them in those folders:

unzip pluf-master.zip

unzip indefero-0.8.6.zip

mv pluf-master pluf

mv indefero-0.8.6 indefero

cd /usr/local/www/apache22/data

mkdir indefero

cd indefero


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

 cd /usr/ports/converters/php5-mbstring

make install clean

cd /home/www/indefero/src

dry run:

php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d -u
  PHP include path: .:/usr/local/share/pear:/usr/home/www/pluf/src
  Install all the apps
  Pluf_Migrations_Install_setup
  IDF_Migrations_Install_setup

we need an mysql server

/usr/local/etc/rc.d/mysql-server start

since I did not find the mysql script, I installed the server:

cd /usr/ports/databases/mysql50-server

make install clean


---------

...

Added group "mysql".
Added user "mysql".
************************************************************************

Remember to run mysql_upgrade (with the optional --datadir= flag)
the first time you start the MySQL server after an upgrade from an
earlier version.

************************************************************************
install-info --quiet /usr/local/info/mysql.info /usr/local/info/dir
===> Installing rc.d startup script(s)
===>   Compressing manual pages for mysql-server-5.0.45_1
===>   Registering installation for mysql-server-5.0.45_1
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/mysqld

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/mysql-server

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.mysql.com/


-----------


mysql_install_db --user=mysql

chown -R mysql /var/db/mysql/

chgrp -R mysql /var/db/mysql/

/usr/local/bin/mysqld_safe -user=mysql &

Note: If you encounter Command not found error, use command rehash to update OS path environment variables.

The port installation will put a script file mysql-server.sh in /usr/local/etc/rc.d which will has capability to start MySQL server. To enable MySQL server to start automatically after every FreeBSD server reboot, enter the following command in CLI:

vi /etc/rc.conf

mysql_enable="YES"

reboot

 

 cd /usr/ports/databases/php5-mysql

make install clean

cd /usr/ports/lang/php5-extensions
make install clean

create database:

mysql -h localhost -u root

create a new database

mysql -h localhost -u root

create database website;

SHOW DATABASES;

quit




cd /home/www/indefero/src

dry run:

php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d -u
  PHP include path: .:/usr/local/share/pear:/usr/home/www/pluf/src
  Install all the apps
  Pluf_Migrations_Install_setup
  IDF_Migrations_Install_setup

try installing if the stuff before went well

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

create a bootstrap.php file in /usr/local/www/apache22/data/indefero

mine looks like this:

first_name = 'Robert';
$user->last_name = 'Berger'; // Required!
$user->login = 'rber'; // must be lowercase!
$user->email = 'indefero@reliableembeddedsystems.com';
$user->password = 'Password_for_indefero'; // the password is salted/hashed
                                  // in the database, so do not worry :)
$user->administrator = true;
$user->active = true;
$user->create();
print "Bootstrap ok\n";
?>

Execute this through webbrowser:

http://192.168.48.140/indefero/bootstrap.php

You should get "Bootstrap ok" as a reply.

Cook init.php a bit to get pluf in the inclue path:

<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*

// Set the include path to have Pluf and IDF in it.
$indefero_path = dirname(__FILE__).'/../src';
$pluf_path = '/home/www/pluf/src';
set_include_path(get_include_path()
                 .PATH_SEPARATOR.$indefero_path
                 .PATH_SEPARATOR.$pluf_path
                 );
require 'Pluf.php';
Pluf::start(dirname(__FILE__).'/../src/IDF/conf/idf.php');
Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));
Pluf_Dispatcher::dispatch(Pluf_HTTP_URL::getAction());
 

Now go with your webbrowser to: http://192.168.48.140/indefero/

You should be greeted with:

Sign in or create your account | Project List | Help Projects

No projects managed with InDefero were found.

Managed Projects: 0 Powered by InDefero, a CĂ©ondo Ltd initiative.

Because my url is http://some_ip/indefero/ I had to configure the links properly.

modify in /home/www/indefero/src/IDF/conf/idf.php

$cfg['idf_base'] = '/index.php';

to look like this:

$cfg['idf_base'] = '/indefero/index.php';

right after logging in I get: Security error: "secret_key" is not set in the configuration file.

So let's set it:

$cfg['secret_key'] = 'TraRaBumBumTraRaDerKasperlDerIstDaZippediZappediZuppMitDemZirkusHabakuk';

Since the url seems to sometimes be composed from config settings let's configure this as well

$cfg['url_base'] = 'http://192.168.48.140';

config file, which seems to work (no git integration yet, but also css is working)

cat idf.pdp

$cfg = array();

$cfg['debug'] = true;
$cfg['debug_scm'] = false;

$cfg['git_repositories'] = '/home/git/repositories/%s.git';
$cfg['git_remote_url'] = 'git://192.168.48.140/%s.git';
$cfg['git_write_remote_url'] = 'git@192.168.48.140:%s.git';

$cfg['svn_repositories'] = 'file:///home/svn/repositories/%s';
$cfg['svn_remote_url'] = 'http://localhost/svn/%s';

$cfg['admins'] = array(
                       array('Admin', 'you@example.com'),
                       );


$cfg['send_emails'] = false;
$cfg['mail_backend'] = 'smtp';
$cfg['mail_host'] = 'localhost';
$cfg['mail_port'] = 25;

$cfg['idf_base'] = '/indefero/index.php';
$cfg['url_base'] = 'http://192.168.48.140';

$cfg['url_media'] = 'http://192.168.48.140/indefero/media';

$cfg['url_upload'] = 'http://192.168.48.140/indefero/media/upload';


$cfg['upload_path'] = '/home/www/indefero/www/media/upload';

$cfg['upload_issue_path'] = '/home/www/indefero/attachments';

$cfg['secret_key'] = 'TraRaBumBumTraRaDerKasperlDerIstDaZippediZappediZuppMitDemZirkusHabakuk';


$cfg['from_email'] = 'sender@example.com';


$cfg['bounce_email'] = 'no-reply@example.com';

$cfg['tmp_folder'] = '/tmp';


$cfg['db_login'] = 'root';
$cfg['db_password'] = '';
$cfg['db_server'] = '';
$cfg['db_version'] = '5.0'; # Only needed for MySQL
$cfg['db_table_prefix'] = 'indefero_';
$cfg['db_engine'] = 'MySQL'; # SQLite is also well tested or MySQL
$cfg['db_database'] = 'website'; # put absolute path to the db if you
                                 # are using SQLite.

$cfg['pear_path'] = '/usr/share/php';

$cfg['login_success_url'] = $cfg['url_base'].$cfg['idf_base'];
$cfg['after_logout_page'] = $cfg['url_base'].$cfg['idf_base'];


$cfg['cache_engine'] = 'Pluf_Cache_File';
$cfg['cache_timeout'] = 300;
$cfg['cache_file_folder'] = $cfg['tmp_folder'].'/cache';


$cfg['template_folders'] = array(
                                 dirname(__FILE__).'/../templates',
                                 );


$cfg['installed_apps'] = array('Pluf', 'IDF');
$cfg['pluf_use_rowpermission'] = true;
$cfg['middleware_classes'] = array(
         'Pluf_Middleware_Csrf',
         'Pluf_Middleware_Session',
         'IDF_Middleware',
         'Pluf_Middleware_Translation',
         );
$cfg['template_context_processors'] = array('IDF_Middleware_ContextPreProcessor');
$cfg['idf_views'] = dirname(__FILE__).'/urls.php';


$cfg['languages'] = array('en', 'fr');


$cfg['allowed_scm'] = array('git' => 'IDF_Scm_Git',
                            'svn' => 'IDF_Scm_Svn',
                            'mercurial' => 'IDF_Scm_Mercurial',
                            );


return $cfg;

Created: 11 years 3 months ago
by Natalie Adams

Page rendered in 0.03175s using 24 queries.