=====Gosa=====
====Prerequisites====
The Gosa framework is an PHP-application so we need a webserver that supports PHP. Although most data will be stored in a LDAP-database, some data for Gosa plugins will be stored in a MySQL-database.
* Hannibal documentation on [[hannibal:apache|howto install an Apache webserver]] with support for PHP.
* Hannibal documentation on [[hannibal:mysqlserver|howto install a MySQL-database]].
* Hannibal documentation on [[hannibal:fds|howto install a LDAP server]] for user authentication.
For several reasons we usually configure the server on which we install Gosa as a LDAP-client. We also install the smbldap CLI-tools on the Gosa-server.
* Hannibal documentation on [[hannibal:ldap-auth|howto turn a server into a LDAP-client]].
Documentation on howto deploy the Smbldap-tools is available in the [[hannibal:fileserver#samba_version-3|Hannibal fileserver section]].
Install these packages to satisfy the Gosa software dependencies and requirements.
apt-get install apache2 apache2-utils libapache2-mod-php5 \
php5-recode php5 php5-cli php5-gd php5-imagick php5-imap \
php5-ldap php5-memcache php5-mhash php5-mysql php5-snmp \
libgd2-xpm smarty smarty-gettext fping libcrypt-smbhash-perl \
wwwconfig-common
apt-get install mysql-server-5.0 mysql-client-5.0 libdbd-mysql-perl
And in case you haven't already done so as described in the [[hannibal:operatingsystem|Hannibal operating system base section]]:
apt-get install sudo postfix
The Gosa-documentation on installation of PHP is available at https://oss.gonicus.de/labs/gosa/wiki/InstallingPHP
====Installation====
Binary packages for Debian Sarge are available for download at http://oss.gonicus.de/pub/gosa/debian/
These packages also install on Debian Etch.
Download the software and install the packages:
dpkg -i gosa_2.5.15-1sarge1_all.deb
dpkg -i gosa-help-nl_2.5.15-1sarge1_all.deb
These debs install in /usr/share/gosa.
====Configuration====
===PHP configuration===
Edit these entries in /etc/php5/apache2/php.ini
...
register_globals = off
session.gc_maxlifetime >= 86400
session.auto_start = off
memory_limit >= 64M
implicit_flush = off
max_execution_time >= 30
expose_php = off
magic_quotes_gpc = on
zend.ze1_compatibility_mode = off
...
===Gosa.conf===
Edit /etc/gosa/gosa.conf
{if $cv.generic_settings.enableDNS}
{else}
{/if}
{if $cv.generic_settings.enableDHCP}
{else}
{/if}
In the xml file replace in the section main the parameters:
* default= with your site name
* sid= with the sid of your samba-server
* server= with the uri tot your primary or slave ldap-server
* config= with your ldap-connection string
* referral url= with the uri tot your primary ldap-server
* password=
===Custom scripts===
As described in the [[https://oss.gonicus.de/labs/gosa/wiki/FAQ|Gosa FAQ]] each Gosa plugin in gosa.conf may have an entry "postremove", "postmodify" and "postcreate". You can use ldap attributes as command line options. For instance we wanted Gosa to automagically create a homedir for a user when a user is created so we added a postcreate option to the postxAccount-class in gosa.conf:
...
postcreate="/usr/bin/sudo /usr/local/bin/gosa_create_homedir.sh %uid"
...
Then create the script /usr/local/bin/gosa_create_homedir.sh
#!/bin/bash
# 2008, Hannibal devel-team
# This script is to be called by a 'postcreate' action from within
# the Hannibal Gosa webinterface. An example follows:
#
# postcreate="/usr/bin/sudo /usr/local/bin/gosa_create_homedir.sh %uid"
#
# The user running the webserver (usually www-data) will execute the
# script wrapped by sudo. So you need to grant the www-user sudo
# permissions to run this script.
# The script takes one argument which should be the username.
mkdir -p /home/$1
sleep 2
chown -R $1 /home/$1
Set proper permissions on the script.
chmod 744 /usr/local/bin/gosa_create_homedir.sh
Then grant the www-data user sudo permissions to execute the script.
Run 'visudo' and add lines like so:
...
Cmnd_Alias GOSA = /usr/local/bin/gosa_create_homedir.sh
...
www-data ALL = (ALL) NOPASSWD: GOSA
...
====Action====
Now point youw webbrowser to http://xenweb01.example.local/gosa and login in with username gosadmin and password xxxxx.