This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
using_a_centralized_postgresql_db_with_x2goserver_debian [2011/05/27 11:54] sunweaver |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Installation ====== | ||
| - | |||
| - | NOTE: This wiki page explains how you can configure X2go with PostgreSQL as database backend. However, this is only recommended for sites that run more than one X2go server (X2go server cluster). If you have one standalone X2go server then please use the SQLite database backend (which is the default after installation of the x2goserver package). | ||
| - | |||
| - | Changes since x2goserver v3.0.99.x: | ||
| - | |||
| - | The '' | ||
| - | SQLite database (installation default) nor the PostgreSQL database. Since v3.0.99.x | ||
| - | PostgreSQL views and rules are used to restrict users from modifying or accessing | ||
| - | data of other users. | ||
| - | |||
| - | The ' | ||
| - | the users who are allowed to take part in desktop sharing must be part of group x2gousers). | ||
| - | |||
| - | For accessing X2go/ | ||
| - | |||
| - | __Preparations: | ||
| - | |||
| - | * configure PostgreSQL server to enable TCP connections from your X2go server host | ||
| - | * configure PostgreSQL server for md5 authentication for users from x2goserver in | ||
| - | |||
| - | < | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | __Example: | ||
| - | |||
| - | < | ||
| - | # IPv4 local connections: | ||
| - | |||
| - | host all | ||
| - | </ | ||
| - | |||
| - | You must create a database user which can create databases and users for | ||
| - | X2go database administration. You can also use the '' | ||
| - | job. | ||
| - | |||
| - | You must save the password of this user in the file | ||
| - | |||
| - | < | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | Only root should have access to | ||
| - | this file. It will be used only for database and user creation, you | ||
| - | may/should delete it after these tasks are done. You can set a new password | ||
| - | using this command on your PostgreSQL server: | ||
| - | |||
| - | < | ||
| - | $ su postgres -c " | ||
| - | psql (8.4.8) | ||
| - | |||
| - | You are using psql, the command-line interface to PostgreSQL. | ||
| - | Type: \copyright for distribution terms | ||
| - | \h for help with SQL commands | ||
| - | \? for help with psql commands | ||
| - | \g or terminate with semicolon to execute query | ||
| - | \q to quit | ||
| - | |||
| - | postgres=# alter user postgres encrypted password '< | ||
| - | ALTER ROLE | ||
| - | postgres=# \q | ||
| - | |||
| - | </ | ||
| - | |||
| - | __Database configuration in file / | ||
| - | |||
| - | #postgres or sqlite | ||
| - | backend=postgres | ||
| - | |||
| - | [postgres] | ||
| - | host=localhost | ||
| - | port=5432 | ||
| - | |||
| - | #database admin (must have permissions to create databases and users) | ||
| - | dbadmin=postgres | ||
| - | |||
| - | #disable: SSL connections are never used | ||
| - | #allow: try non-SSL, then SSL | ||
| - | #prefer: try SSL, then non-SSL | ||
| - | #require: connect only with SSL | ||
| - | #default - prefer | ||
| - | ssl=prefer | ||
| - | |||
| - | Database administration using ''/ | ||
| - | |||
| - | < | ||
| - | $ / | ||
| - | X2Go SQL admin interface. Use it to create x2go database and insert or | ||
| - | remove users or groups in x2go database | ||
| - | Usage: | ||
| - | x2godbadmin --createdb | ||
| - | x2godbadmin --listusers | ||
| - | x2godbadmin --adduser|rmuser <UNIX user> | ||
| - | x2godbadmin --addgroup|rmgroup <UNIX group> | ||
| - | </ | ||
| - | |||
| - | __Create database (evoke on X2go server):__ | ||
| - | |||
| - | < | ||
| - | $ x2godbadmin --createdb | ||
| - | </ | ||
| - | |||
| - | __Create database users:__ | ||
| - | |||
| - | < | ||
| - | You can add UNIX users or groups to database using commands | ||
| - | $ x2godbadmin --adduser example | ||
| - | |||
| - | < | ||
| - | $ x2godbadmin --addgroup x2gousers | ||
| - | </ | ||
| - | |||
| - | After that step users can create x2go sessions. | ||
| - | |||
| - | ====== Installation (for x2goserver < 3.0.99.x - old code, please upgrade your x2goserver) ====== | ||
| - | :!: **Before you begin!** | ||
| - | > Please make sure that you have added the x2go repository to your package management system. The required steps are described here: [[adding the x2go repository (debian)]]! You'll further need to have some experience with x2goprint and maybe x2goserver. | ||
| - | ==== Using an existent database server on the network ==== | ||
| - | |||
| - | If you want to use an already existent PostgreSQL database server in your network, you'll need to allow the x2goserver(s) access to the database server. | ||
| - | First of all, you'll need to tell the address of the target server to every x2goserver: | ||
| - | |||
| - | < | ||
| - | # echo -n „address of postgres server“ > / | ||
| - | </ | ||
| - | |||
| - | Furthermore you'll need to allow “passwordless” authentication via SSH keys. Please don't add a “paraphrase” to the generated key: | ||
| - | |||
| - | < | ||
| - | # mkdir / | ||
| - | # ssh-keygen -t dsa -f / | ||
| - | </ | ||
| - | |||
| - | To copy the public part of the key to the PostgreSQL server, you may use the “ssh-copy-id” command to combine transfer and paste command, or you can paste the key after transferring it by yourself (make sure file permissions for SSH key authentication are set correctly): | ||
| - | |||
| - | < | ||
| - | # mkdir -p ~postgres/ | ||
| - | # cat id_dsa-pub >> ~postgres/ | ||
| - | # chown -Rf postgres: | ||
| - | # chmod -Rf go-rwx ~postgres/ | ||
| - | </ | ||
| - | |||
| - | You can test the needed connection by entering following command: | ||
| - | |||
| - | < | ||
| - | # ssh -i / | ||
| - | </ | ||
| - | |||
| - | You'll also need to run the “x2gocreatebase.sh” script as described before on the database server to create the needed instance. | ||
| - | |||
| - | |||
| - | New server packages (deb and tar.gz) are available over our heuler | ||
| - | repository: | ||
| - | http:// | ||
| - | |||
| - | You can install this packages with apt: | ||
| - | deb http:// | ||
| - | |||
| - | Please keep in mind, that the heuler archive is an additional repository | ||
| - | - you'll need to have the lenny repository configured as well! | ||
| - | |||