Simple Groupware Installation

Simple Groupware is a 100% web-based application. All required components are installed on the server. The client only needs a web-browser. This page describes how to set up the server. The Simple Groupware setup will check permissions, verify the system configuration, and create the database structure automatically.
If you need synchronization on the client, please take a look at SyncML integration or offline synchronization.


MySQL / MariaDB (5.x recommended)


If the user is not root, make sure the user has the following privileges on the Simple Groupware database:

  • Data: SELECT, INSERT, UPDATE, DELETE
  • Structure: CREATE, ALTER, INDEX, DROP, CREATE VIEW
  • Administration (optional): PROCESS

The setup will try to create the database if it doesn't exist. In this case, the user needs the privilege to create databases. For more information about privileges in MySQL, see the online manual. If you're getting "Access denied" errors from the database, you might this page. Experts can optimize MySQL performance with this tool.


PostgreSQL (8.3.x recommended)


When using PostgreSQL instead of MySQL, please make sure to create a database with "UTF8" set in the encoding, or provide the super user credentials so that the database is created automatically.
When using PostgreSQL 8.1/8.2, the "tsearch2" fulltext extension needs to be installed in the database before running the Simple Groupware installation. If you haven't selected "tsearch2" during the PostgreSQL installation, you need to create the database manually and execute the queries from "<postgresql>/share/contrib/tsearch2.sql" using pgAdmin3. The path may be different in your Linux distribution (e.g. /usr/share/postgresql/8.x/contrib/), please check the manuals from your distribution.


SQLite (3.x recommended)


The SQLite database gets automatically created at "<sgs-dir>/simple_store/sqlite3_<database-name>.db". Since SQLite has no authentication, the fields hostname, username and password can hold any non-empty value. The database administration can be done with SQLite Administrator. Please make sure to install the PDO driver for SQLite v3.


Oracle (10.x recommended, support discontinued by the end of 2010)


When using Oracle instead of MySQL, the database doesn't get automatically created. Therefore you need to create an empty database with the Oracle administration tools and give the user the roles "Connect" and "Resource" and the privilege "Create view". The database structure is created automatically by Simple Groupware.
Moreover, you need to set the system environment variable "NLS_LANG" to "AMERICAN_AMERICA.AL32UTF8".
When using Simple Groupware versions before 0.301, please make sure that your php.ini uses the right variables_order to register the environment variable properly:
variables_order = "EGPCS"


nginx (1.x recommended)


Beginning with release 0.721, nginx can be used as web server running PHP in FastCGI mode. A sample configuration is included in "<sgs-dir>/tools/nginx/nginx.conf". Please make sure to use spawn-fcgi instead of calling php-cgi -b xxx directly.


Installation with Linux (Debian 4/5/6)


  • Note: When using a hosted platform, you can skip the next three steps
  • Install the missing packages:
    apt-get install catdoc ppthtml imagemagick unzip xpdf-utils mp3info exiv2 graphviz apache2.2-common libapache2-mod-php5 php5-gd php-apc
    apt-get remove php5-suhosin
    with MySQL (Debian 5): apt-get install php5-mysql mysql-server-5.0
    with MySQL (Debian 6): apt-get install php5-mysql mysql-server-5.1
    with MySQL (Ubuntu): apt-get install php5-mysql mysql-server-5.5
    with PostgreSQL: apt-get install php5-pgsql postgresql-8.4
    with SQLite: apt-get install php5-sqlite
    with Java (Ubuntu server): apt-get install gcj-4.6-jre-headless
    with Java (Debian): apt-get install gij
  • Uncomment ";extension=gd.so" in /etc/php5/apache2/php.ini (Debian 4 only)
  • Restart Apache (/etc/init.d/apache2 restart)
  • Make sure you have MySQL (or PostgreSQL / none for SQLite) and Apache running
  • Download the Simple Groupware installer here
  • Create a new directory under your document root and make it world writable
    (e.g. /var/www/sgs/)
  • Extract the .gz-file (e.g. to /var/www/sgs/)
    (You should now have an existing file like /var/www/sgs/sgs_installer.php)
  • If your server is not connected to the internet, please download the latest version of Simple Groupware (tar.gz) here and place the archive next to "sgs_installer.php".
  • Open your browser and go to: http://your_server/sgs/sgs_installer.php.
    You should now see a page with the title "Simple Groupware Installer".
    Choose your version and click "Install". After the download has finished, click "Continue".
  • Then choose your language. After translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Installation with Linux (SuSE 10.1)


  • Make sure you have installed MySQL (or PostgreSQL), Apache, Php, Php-gd, Php-zlib
  • Download the Simple Groupware installer here
  • Create a new directory under your document root and make it world writable
    (e.g. /srv/www/htdocs/sgs/)
  • Extract the .gz-file (e.g. to /srv/www/htdocs/sgs/)
    (You should now have an existing file like /srv/www/htdocs/sgs/sgs_installer.php)
  • If your server is not connected to the internet, please download the latest version of Simple Groupware (tar.gz) here and place the archive next to "sgs_installer.php".
  • Open your browser and go to: http://your_server/sgs/sgs_installer.php.
    You should now see a page with the title "Simple Groupware Installer".
    Choose your version and click "Install". After the download has finished, click "Continue".
  • Then choose your language. After translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Installation with Linux (Amazon Linux AMI, EC2, no RDS)


  • Create a new EC2 instance (Amazon AMI Linux)
  • Assign a new IP address:
    In AWS Management Console, click on "Elastic IPs" and "Allocate New Address", choose EC2. Once the address is created, click on it, then click "Associate Address".
    Select the EC2 instance and associate it.
  • Enable port 80:
    In AWS Management Console, click on "Security Groups" in the Navigation panel.
    Select the Security Group that you used for the instance (e.g. quicklaunch-1).
    Under the "Inbound" tab (bottom), create a new "HTTP" rule and click "Apply Rule Changes".
  • Log into the new instance with SSH
  • Set the right time zone (e.g. Berlin):

sudo ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
date

  • Install the missing packages:

sudo yum install php-mysql php php-cli php-gd php-xml php-soap php-mbstring php-pecl-apc mysql httpd mysql-server graphviz ImageMagick poppler-utils
sudo /sbin/chkconfig httpd on && sudo /sbin/chkconfig mysqld on
sudo /etc/init.d/mysqld start && sudo /etc/init.d/httpd start
sudo chmod 0777 /var/www/html/
cd /var/www/html/
wget --no-check-certificate http://bit.ly/sginstall
(You should now have an existing file /var/www/html/sgs_installer.php)

  • Set the MySQL password for the user root:

mysqladmin -u root password '<mysql-password>'

  • Open your browser and go to: http://your_server_ip/sgs_installer.php.
    You should now see a page with the title "Simple Groupware Installer".
    Choose your version and click "Install". After the download has finished, click "Continue".
  • Then choose your language. After translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Installation with Windows (Apache / XAMPP)


  • Go to http://www.apachefriends.org/en/xampp-windows.html
  • Download XAMPP Lite as .zip archive (e.g. XAMPP Lite 1.4.15, 26 MB)
  • Extract the .zip-file (e.g. xampplite-win32-1.4.15.zip to c:\xampp)
  • Run setup_xampp.bat (e.g. C:\xampp\xampplite\setup_xampp.bat)
  • Run xampp_start.exe (e.g. C:\xampp\xampplite\xampp_start.exe)
  • Open your browser and go to http://localhost/xampp/index.php. You should now see a page with the title "Welcome to XAMPP for Windows xy (lite)".
  • Download the Simple Groupware installer here
  • Create a new directory under your document root and make it world writable
    (e.g. C:\xampp\xampplite\htdocs\sgs)
  • Extract the .gz-file (e.g. to C:\xampp\xampplite\htdocs\sgs)
    (You should now have an existing file like C:\xampp\xampplite\htdocs\sgs\sgs_installer.php)
  • If your server is not connected to the internet, please download the latest version of Simple Groupware (tar.gz) here and place the archive next to "sgs_installer.php".
  • Open your browser and go to: http://your_server/sgs/sgs_installer.php.
    You should now see a page with the title "Simple Groupware Installer".
    Choose your version and click "Install". After the download has finished, click "Continue".
  • Then choose your language. After translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Installation with IIS7 (Microsoft Internet Information Server 7, Windows 2008 Server)


  • Make sure that IIS is installed and running
  • Install PHP as described in this tutorial.
    When running the PHP installer (section Install PHP on IIS 7), make sure to select the extensions "GD2" and "MySQL / PostgreSQL".
  • Download the Simple Groupware installer here
  • Create a new directory under your document root and make it writable for the group "IIS_IUSRS" and the user "NETWORK SERVICE"
    (e.g. c:\inetpub\wwwroot\sgs)
  • Extract the .gz-file (e.g. to c:\inetpub\wwwroot\sgs)
    (You should now have an existing file like c:\inetpub\wwwroot\sgs\sgs_installer.php)
  • If your server is not connected to the internet, please download the latest version of Simple Groupware (tar.gz) here and place the archive next to "sgs_installer.php".
  • Open your browser and go to: http://your_server/sgs/sgs_installer.php.
    You should now see a page with the title "Simple Groupware Installer".
    Choose your version and click "Install". After the download has finished, click "Continue".
  • Then choose your language. After translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Note: The IIS server does not include the mod_rewrite module. Therefore the Simple Groupware WebDAV server can't run on IIS.


Installation with IIS (Microsoft Internet Information Server 6)


  • Make sure that IIS is installed and running
  • For Windows XP: Install the PHP ISAPI filter under "Default Web Site":
    Filter name: PHP
    Executable: <php-dir>\php5isapi.dll
  • For Windows 2003 server: Add PHP as a new Web Service Extension:
    Extension name: PHP
    Required files: <php-dir>\php5isapi.dll
    Set extension status to Allowed: Checked
  • Make sure that "%systemroot%\system32\cmd.exe" has "Read & Execute" permissions for the users "IUSR_<hostname>" and "NT Authority\Network Service" (needed to preview documents and create thumbnail images)
  • Download the latest version of Simple Groupware here (at least 0.298)
  • Extract the .tar.gz-file (e.g. to C:\Inetpub\wwwroot\sgs)
    (You should now have an existing folder like C:\Inetpub\wwwroot\sgs\src)
  • Make the folders sgs/simple_cache, sgs/simple_store, sgs/bin, sgs/old writable for the users "IUSR_<hostname>" and "NT Authority\Network Service"
  • Open the IIS snap-in and navigate to "Default Web Site"
  • Open the "Properties" of the "sgs" folder and click "Create" in "Application settings"
  • Then click "Configuration" and add a new mapping:
    Executable: <php-dir>\php5isapi.dll
    Extension: .php
  • Confirm the changes
  • Restart IIS (complete restart, start+stop of "Default Web Site" is not enough)
  • In your browser go to http://localhost/sgs/.
    You should now see a page with the title "Simple Groupware".
    Choose your language. After the translations are built, click "Continue".
  • Type in your database credentials
  • Type in your super administrator credentials
  • Confirm the GPLv2 and click "Install"
  • In the next screen click "Continue"
  • Enjoy Simple Groupware!


Note: The php.ini is located in the %systemroot% directory (e.g. c:\winnt). If it does not exist, please create it.

Note: The IIS server does not include the mod_rewrite module. Therefore the Simple Groupware WebDAV server can't run on IIS.


PHP settings


During the setup, Simple Groupware automatically checks you PHP settings. If a setting is not Ok, the setup stops with a message to change the setting.
The settings in detail:

  • PHP version: at least 5.3.0
  • Required database module: any of mysql, pgsql, sqlite
  • Required modules: xml, gd / gd2, pcre, session, zlib


Required PHP settings

SettingValueDescription
zlib.output_compressionoffno automatic output compression
file_uploadsonenable file uploads
memory_limitundefined or at least 24M
session.auto_startoffmanual session handling
magic_quotes_runtimeoffmanual quoting
safe_mode (safe mode)offneeded for document preview
allow_url_fopenonneeded for accessing RSS feeds
register_globalsoffsecurity (until 0.409)
display_errorsonbetter error handling (until 0.657)
apc.shm_size64Mbetter performance

Installations running unicode languages (Arabic, Chinese, Croatian, Czech, Greek, Polish, Russian, Slovak, Swedish, Ukrainian): Please make sure to load the mbstring extension in your php.ini (e.g. extension=php_mbstring.dll or extension=php_mbstring.so) if it is not already loaded and add these lines:

[mbstring]
mbstring.internal_encoding = UTF-8
mbstring.func_overload = 2


Description

When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function. This does not protect you against security bugs in PHP or any kind of misuse of the system. Using safe_mode, all files within Simple Groupware must have the same owner, but oftentimes the FTP user is different from the user of the web-server. Also it won't be possible to use tools like imagemagick or catdoc, thus searching in files or previewing images will not work. Therefore safe_mode should be off.

The setting memory_limit should be set to a value equal or higher than 24M to run the installation properly.

If you want to read RSS feeds from servers around the web (RSS data handler), you'll need to set allow_url_fopen to on. This allows PHP to read a remote URL just like a local file. This setting is optional and is not forced by the setup.

If you don't have access to change the php.ini file, it may be possible to adapt the settings by using a graphical interface or create a second php.ini or a .htaccess file. See your hoster's documentation to find out what method you should use.

A .htaccess file is an additional configuration file that affects the directory it is in and all its subdirectories. It requires PHP to loaded as an Apache module. It is not available for (Fast-)CGI. It should be placed in the Simple Groupware installation directory and it contains lines like: php_value register_globals 0

Note: With the "php_value" command, flags must be represented as "0" or "1". E.g. using "php_value safe_mode off" will not work. So the rules in a .htaccess or config file should look like this:

php_value safe_mode 0
php_value zlib.output_compression 0

Older Simple Groupware versions (before 0.657) require display_errors to be set to on in php.ini. This makes error messages appear on the user's screen as an addition to the database logging. That way users are told that something went wrong, instead of believing everything is OK. This helps a lot to solve problems and avoid frustration with missing error messages. Some errors like memory limit exceptions or other critical errors cannot be logged to the database, so it's better to show them instead of presenting a blank screen to the user. The error messages on the screen will never contain any kind of confidential information like memory dumps, stack-traces or information about the database server.

Older Simple Groupware versions (before 0.409) require register_globals to be "off" because "on" can cause a lot of security problems. Newer versions contain special algorithms to protect against register_globals misuse. But whenever possible, this setting should be off (default in PHP5). Normally you can read hacking attacks against PHP programs every week at www.heise-security.co.uk. In most cases, register_globals = on is the door opener for these attacks.

Older Simple Groupware versions (before 0.400) require to disable session.use_trans_sid. If activated without server based output buffering, URLs are automatically expanded with the session id in case the browser has cookies disabled. This can be an additional security risk if users send a URL with an active session id to someone else by email. Therefore session.use_trans_sid should be disabled.


Security


It is recommended to install the latest security updates for the operating system and its components (Apache / PHP / MySQL). Using a shared hosting platform can cause unwanted downtime, resource fluctuation, and security problems. If you want to provide better security for your data, use a dedicated server and make sure to limit physical access to a limited number of people.

Using the Apache module mod_rewrite makes Simple Groupware more secure. Directories like "simple_store/" or "simple_cache/" don't need to be accessible from the outside. Per default, files within these directories are protected with a random hash function, but attackers might override this after a certain time. Therefore a ".htaccess" is already included in these directories and prohibits access if mod_rewrite is laoded.

When using Suhosin, please make sure to disable "session encryption". This feature is enabled by default, but unfortunately not working correctly with PHP 5. Therefore you can edit "suhosin.ini" (e.g. under /etc/php5/conf.d/) and replace:

;suhosin.session.encrypt = on

with:

suhosin.session.encrypt = off

Then restart Apache (/etc/init.d/apache2 restart).

If there are any problems with the setup or the running system, you might also check the configuration of SELinux or suPHP if present.


PHP extensions


PHP consists of core functions and functions loaded from extensions. Extensions are libraries that are used for database connections, image creation, data compression, web services, etc.
In Windows, extensions are .dll files, in Linux/Unix they reside in .so files. Extensions need to be compiled for every PHP version, so if you're not using a binary distribution of PHP you might need to compile them. Fortunately, all extensions required by Simple Groupware are available as binary files for Linux and Windows.

For Windows, you only need to define the directory for the extensions in your php.ini and define what extensions to load:

; Directory for the extensions:
extension_dir = "<directory in your file system>"

; Image creation for the stats module:
extension=php_gd2.dll

; Connecting to LDAP:
extension=php_ldap.dll

; MySQL connection:
extension=php_mysql.dll

; PostgreSQL connection:
extension=php_pgsql.dll

; Oracle connection:
extension=php_oci8.dll

; SQLite connection (also applies to XAMPP):
extension=php_pdo.dll
extension=php_pdo_sqlite.dll

; OpenSSL connections:
extension=php_openssl.dll


For Linux / Unix, you need to install additional packages from your distribution to use the extensions:

; example for installing the GD library in Debian
apt-get install php5-gd

; example for installing the GD library in SuSE yast
; run the module for software installation
; select the package Php-gd and install it


Preview documents with Windows (optional)


In order to preview documents and images with Windows, you need to install the extension "Win32 binaries" using the Extension Manager. It is also recommended to install a Virus scanner on the system.


Preview documents with Linux (optional)


In order to preview documents and images with Linux, you need to install some packages:

catdoc, xlhtml, ImageMagick, Xpdf, UnZip, gzip, tar, mp3info, exiv2, Graphviz

Debian:

Simple Groupware also includes Debian binaries (which can be activated here), but it is more safe to use the standard packages:

 apt-get install catdoc
 apt-get install ppthtml
 apt-get install imagemagick
 apt-get install xpdf-utils
 apt-get install unzip
 apt-get install mp3info
 apt-get install exiv2
 apt-get install graphviz

SuSE:

Install the packages ImageMagick, xpdf-tools, unzip, Graphviz, tk with Yast.
For catdoc you need to download the rpm-package here and install it with:

rpm -i catdoc-0.93.3-2.i386.rpm

For ppthtml you need to download the rpm-package here and install it with:

rpm -i xlhtml-0.5.1-3.i386.rpm

For mp3info you need to download the rpm-package here and install it with:

rpm -i mp3info-0.8.5a-1.i386.rpm

For exiv2 you need to download the rpm-package here and install it with:

rpm -i libexiv2-0.12-101.pm.1.i586.rpm


Using the CIFS module / NTLM authentication (Single sign-on, optional)


If you want to get direct access to a CIFS server (e.g. Samba, Windows or NetApp), you need to start the PHP/Java Bridge on the Simple Groupware server:

cd <sgs-dir>/bin/tools/java_bridge/
java -jar JavaBridge.jar INET_LOCAL:9676 3 ../../../simple_cache/debug/java_bridge.log

# Windows background process
cd <sgs-dir>/bin/tools/java_bridge/
start /B java -jar JavaBridge.jar INET_LOCAL:9676 3 ../../../simple_cache/debug/java_bridge.log

# Linux background process
cd <sgs-dir>/bin/tools/java_bridge/
java -jar JavaBridge.jar INET_LOCAL:9676 3 ../../../simple_cache/debug/java_bridge.log &

Note: To start the PHP/Java Bridge on your system, a Java Runtime is required (e.g. with Debian apt-get install gij or apt-get install gcj-4.6-jre-headless). Please make sure to use at least gij 4.3.2 or gcj 4.6 (java 1.5.0).

Note: Beginning with Simple Groupware 0.510, the Java Bridge is automatically started. The log file is in "<sgs-dir>/simple_cache/debug/java_bridge.log".

Now PHP is able to use the jCIFS library (written in Java) and get direct access to a file server based on the CIFS protocol.


Uninstall Simple Groupware


Remove all files from the hard disk (e.g. C:\xampp\xampplite\htdocs\sgs for Windows or /srv/www/htdocs/sgs for Linux)

Remove all items from the database:

  • MySQL: drop all tables with the prefix "simple_" or delete the complete database (e.g. using phpMyAdmin)
  • PostgreSQL:
    drop all tables with the prefix "simple_"
    drop the views "show_full_columns", "show_processlist", "show_table_status" and "show_index"
    drop the custom functions "instr" and "concat"
    or delete the complete database (e.g. using pgAdminIII)
  • Oracle Database:
    drop all tables with the prefix "simple_"
    drop the views "show_full_columns", "show_index" and "show_table_status"
  • SQLite:
    remove the database file at "<sgs-dir>/simple_store/sqlite3_<database-name>.db"


Unattended installation of Simple Groupware


You can install Simple Groupware without the web interface using this command in a shell:

php -d register_argc_argv=1 -q <sgs-dir>/src/ext/install_unattended.php.txt <url> <lang-code> <admin-user> <admin-pw> <db-type> <db-host> <db-name> <db-user> <db-pw> <demo-data>

The parameters in detail:

  • url = http://<your-server>/<your-sgs-dir>/src/index.php
  • lang-code = ar, cz, cn, da, de, en, enUK, es, fr, gr, hr, hu, idn, it, nl, pl, ptBR, ru, se, sk, tr, uk
  • admin-user = super administrator username
  • admin-pw = super administrator password
  • db-type = mysql, pgsql, oci8, sqlite
  • db-host = database hostname / ip
  • db-name = database name
  • db-user = database username
  • db-pw = database password (use '_' if empty)
  • folder-structure = 0=full, <file>=path / folder template
    e.g. modules/core/folders.xml, modules/core/folders_small.xml

If the script completes successfully, the return code is 0. If there are errors, return code is 1.


Example:

php -q -d register_argc_argv=1 /srv/www/htdocs/sgs/src/ext/install_unattended.php.txt http://localhost/<sgs-url-dir>/src/index.php en admin admin mysql localhost sgs_0290 root _ 0