You are here: Home / Debian GNU/Linux / Web applications / Bookmarks management / Install Sitebar bookmarks manager on Debian

Install Sitebar bookmarks manager on Debian

by Pierre-Yves Landuré last modified Oct 13, 2013 10:36

Sitebar is a online bookmarks manager conceived to be used in a lateral panel. It is interesting for its work-groups functionalities and the possibility to organize bookmarks in folders.

This howto is tested on :

  • Debian 6.0 Squeeze

This howto is tested with these versions of Sitebar :

  • 3.4 nightly

Prerequisites

This howto needs :

This howto needs one of these tools, according to the installed HTTP server :

Parameters

Provide the domain name where will be available the software :

DOMAIN="sitebar.domaine-exemple.fr"

Provide the protocol used to view the software (http or https):

PROTOCOL="http"

Provide the MySQL server host :

MYSQL_HOST="localhost"

If the MySQL server is not local, the mysql-tools script will try to connect with MySQL client, or in case of connection failure, through SSH.

Installation

Compute the installation path :

INSTALL_PATH="/opt/tt-rss/${DOMAIN}"

Make sure that the parent folder exists :

PARENT_PATH="$(command dirname "${INSTALL_PATH}")"
if [ ! -e "${PARENT_PATH}" ]; then
command mkdir --parent "${PARENT_PATH}"
fi

Environment preparation

Install the needed software :

command apt-get install php5-mysql mysql-client subversion

Reload PHP configuration :

test -x /etc/init.d/php5-fpm && /etc/init.d/php5-fpm force-reload
test -x /etc/init.d/apache2 && /etc/init.d/apache2 force-reload
test -x /etc/init.d/lighttpd && /etc/init.d/lighttpd force-reload
test -x /etc/init.d/nginx && /etc/init.d/nginx force-reload

Application installation

Download the sources :

command svn checkout "svn://svn.sitebar.org/sitebar/trunk" "${INSTALL_PATH}"

Note : the downloaded version is 3.4 nightly. This version is a stable "rolling release". The last official stable version (3.3.9) has been released many years ago.

Database creation

Create the database with mysql-tools :

MYSQL_PARAMS="$(command mysql-tools --server="${MYSQL_HOST}" --with-ssh \
--auto-hosts --db-prefix="sitebar" --create "${DOMAIN}")"

Parse the database connection parameters :

MYSQL_DB="$(echo "${MYSQL_PARAMS}" | command grep -e "^MYSQL_DB" \
    | cut --delimiter="=" --fields="2-")"
MYSQL_USER="$(echo "${MYSQL_PARAMS}" | command grep -e "^MYSQL_USER" \
    | cut --delimiter="=" --fields="2-")"
MYSQL_PASSWORD="$(echo "${MYSQL_PARAMS}" | command grep -e "^MYSQL_PASSWORD" \
    | cut --delimiter="=" --fields="2-")"
echo "${MYSQL_PARAMS}"

Initialize database contents :

command mysql --user="${MYSQL_USER}" --password="${MYSQL_PASSWORD}" \
    --host="${MYSQL_HOST}" "${MYSQL_DB}" \
      < "${INSTALL_PATH}/sql/install.sql"

Configuration

Create the configuration file :

echo "<?php

\$SITEBAR = array
(
    'db' => array
    (   
        'host'      =>  '${MYSQL_HOST}',
        'username'  =>  '${MYSQL_USER}',
        'password'  =>  '${MYSQL_PASSWORD}',
        'name'      =>  '${MYSQL_DB}',
    ),
    'baseurl' => '${PROTOCOL}://${DOMAIN}/',
    'login_as' => null,
);
" > "${INSTALL_PATH}/adm/config.inc.php"

Setup the HTTP server for the application :

if [ -x "/usr/bin/a2tools" ]; then
  command a2tools --overrides="FileInfo" "${DOMAIN}" "${INSTALL_PATH}"
fi
if [ -x "/usr/bin/lighty-tools" ]; then
  command lighty-tools add-vhost "${DOMAIN}" "${INSTALL_PATH}"
fi

The software should now be available on the domain name. You can create the administration account.

Automatic software update

Setup a automatic software update script:

echo "#"'!'"/bin/bash
# Update ${PROTOCOL}://${DOMAIN}/ source code from SVN.
test -x '/usr/bin/svn' -a -d '${INSTALL_PATH}' && /usr/bin/svn update '${INSTALL_PATH}' > '/dev/null'" \
    > "/etc/cron.daily/${DOMAIN}-update"
command chmod +x "/etc/cron.daily/${DOMAIN}-update"

Backup

Backup the installation with Backup Manager (see Install and setup Backup Manager on Debian) :

command backup-manager-tools add "${INSTALL_PATH}"

Don't forget to backup the database (see Install and setup MySQL on Debian)

Solving problems

Unreadable display

There is an incompatibility between the software error message and the Apache 2 deflate module. To get a readable error message, disable Apache 2 mod_deflate :

command a2dismod deflate
/etc/init.d/apache2 force-reload

Thanks