openSUSE:Connect installation

Jump to: navigation, search
About - Installation - API

This page explains how to set up the openSUSE:Connect application.

Install LAMP stack

  • either by selecting Web and LAMP Server pattern in YaST + adding mysql-community-server package
  • or running
zypper install -t pattern lamp_server
zypper install mysql-community-server php5-pecl_http php5-mbstring

(php5-pecl_http is available from server:php:extensions)

Checkout source

git clone git://gitorious.org/opensuse/connect.git

Apache setup

  • enable mod_rewrite
    • open /etc/sysconfig/apache2, find line that looks like APACHE_MODULES="..." and add rewrite to the list
    • or use YaST to enable it
  • create a vhost (/etc/apache2/vhosts.d/elgg.conf) pointing to your connect checkout like this (replace /srv/www/vhosts/opensuse.org/connect with full path to Elgg)
 <VirtualHost *:80>
  ServerName localconnect
  DocumentRoot /srv/www/vhosts/opensuse.org/connect
  <Location />
      Allow from All
  </Location>
  <Directory /srv/www/vhosts/opensuse.org/connect>
      AllowOverride All
  </Directory>
 </VirtualHost>
  • add the servername to /etc/hosts:
$ echo 127.0.0.50 localconnect >>/etc/hosts

lighttpd setup

  • open your terminal and type sudo zypper install lighttpd
  • open /etc/lighttpd/lighttpd.conf
  • put mod_rewrite into server.modules
  • append the following code at the end of the file (replace /srv/www/vhosts/opensuse.org/connect with full path to Connect sources):
$HTTP["host"] == "localconnect" {
    server.document-root = "/srv/www/vhosts/opensuse.org/connect"
    url.rewrite = (
        "^/action/([A-Za-z0-9\_\-\/]+)\?(.+)" => "/engine/handlers/action_handler.php?action=$1&$2",
        "^/action/([A-Za-z0-9\_\-\/]+)" => "/engine/handlers/action_handler.php?action=$1",
        "^/services/api/([A-Za-z0-9\_\-]+)/(.*)\?(.+)$" => "/engine/handlers/service_handler.php?handler=$1&request=$2&$3",
        "^/services/api/([A-Za-z0-9\_\-]+)/(.*)$" => "/engine/handlers/service_handler.php?handler=$1&request=$2",
        "^/export/([A-Za-z]+)/([0-9]+)$" => "/services/export/handler.php?view=$1&guid=$2",
        "^/export/([A-Za-z]+)/([0-9]+)/$" => "/services/export/handler.php?view=$1&guid=$2",
        "^/export/([A-Za-z]+)/([0-9]+)/([A-Za-z]+)/([A-Za-z0-9\_]+)/$" => "/services/export/handler.php?view=$1&guid=$2&type=$3&idname=$4",
        "^/_css/css\.css" => "/_css/css.php",
        "^/pg/([A-Za-z0-9\_\-]+)/(.*)\?(.+)" => "/engine/handlers/pagehandler.php?handler=$1&page=$2&$3",
        "^/pg/([A-Za-z0-9\_\-]+)/(.*)" => "/engine/handlers/pagehandler.php?handler=$1&page=$2",
        "^/pg/([A-Za-z0-9\_\-]+)\?(.+)" => "/engine/handlers/pagehandler.php?handler=$1&$2",
        "^/pg/([A-Za-z0-9\_\-]+)" => "/engine/handlers/pagehandler.php?handler=$1",
        "^/xml-rpc.php" => "/engine/handlers/xml-rpc_handler.php",
        "^/mt/mt-xmlrpc.cgi" => "/engine/handlers/xml-rpc_handler.php",
        "^/tag/(.+)/?$" => "/engine/handlers/pagehandler.php?handler=search&page=$1"
    )
}
  • add the servername to /etc/hosts:
$ echo 127.0.0.50 localconnect >>/etc/hosts

Create Elgg database

  • Start mysql client (you can also execute the following without "-p", it works):
mysql -u root -p 
  • Create database, create user and give the user permissions to the database:
CREATE DATABASE connectdb; 
CREATE USER 'connectuser'@'localhost' IDENTIFIED BY 'verycoolpassword'; 
GRANT ALL ON connectdb.* to 'connectuser'@'localhost';
  • or use some GUI interface for doing it (e.g. PHPMyAdmin)

Use the iChain plugin

To use the ichain plugin on your development installation, enable it in the admin settings and add your username to mod/ichain_login/start.php

First run

  • Go to http://localconnect/ and enter your database credentials
  • At Administration -> Tool Administration enable the plugin: "pluginsettings", then use "Import Settings" to import the default plugin list/order from doc/site-export.xml

Problems during the first run

a) Error Message : " Welcome to Elgg - Elgg couldn't connect to the database using the given credentials. "

In order to overcome this problem you have to open (with a text editor) the following file "/connect/engine/settings.php" and add or modify the following arguments as shown here :

// Database username

$CONFIG->dbuser = 'user'; //Your database username

// Database password

$CONFIG->dbpass = 'user'; //Your user's password

// Database name

$CONFIG->dbname = 'connectdb'; // Your database name

// Database server

// (For most configurations, you can leave this as 'localhost')

$CONFIG->dbhost = 'localhost';

// Database table prefix

// If you're sharing a database with other applications, you will want to use this

// to differentiate Elgg's tables.

//$CONFIG->dbprefix = 'Template:CONFIG DBPREFIX';"

b) While configuring "System Settings" and filling the "The full path to the directory where uploaded files will be stored, followed by a trailing slash " , try to add a folder which is not placed in Connect's installation folder. Furthermore give write permission to this folder , by typing :

sudo chmod 777 folder_name