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 09:31] sunweaver |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Installation (obsolete) ====== | ||
| - | :!: **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! | ||
| - | |||
| - | ====== Installation (since 3.0.99.x) ====== | ||
| - | |||
| - | Changes: | ||
| - | |||
| - | Sudo commands are no longer required by x2goserver to contact the | ||
| - | postgresql database. Now postgres views and rules are used to restrict | ||
| - | users form modifying or accessing data of other users. | ||
| - | |||
| - | Sudo isn’t required for the use of x2godesktopsharing (but | ||
| - | the users must be part of group x2gousers) too. | ||
| - | |||
| - | If you want to use x2goserver with sqlite, you still need to configure | ||
| - | sudo. But instead of the user " | ||
| - | will be used. | ||
| - | |||
| - | I've used Perl DBI to work with databases. | ||
| - | |||
| - | |||
| - | How to setup x2goserver with postgres: | ||
| - | |||
| - | configure postgresql server to enable tcp connections from x2goserver | ||
| - | configure postgresql server for md5 authentication for users from | ||
| - | x2goserver in / | ||
| - | |||
| - | # 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 user postgres to do this | ||
| - | job. | ||
| - | |||
| - | You must save the password of this user in the file | ||
| - | / | ||
| - | this file. It will be used only for database and users creation, you | ||
| - | may/should delete it after this tasks are done. You can set new password | ||
| - | using this | ||
| - | commands: | ||
| - | |||
| - | x2goserver:/# | ||
| - | Dies ist psql 8.3.8, das interaktive PostgreSQL-Terminal. | ||
| - | |||
| - | Geben Sie ein: \copyright für Urheberrechtsinformationen | ||
| - | \h für Hilfe über SQL-Anweisungen | ||
| - | \? für Hilfe über interne Anweisungen | ||
| - | \g oder Semikolon, um eine Anfrage auszuführen | ||
| - | \q um zu beenden | ||
| - | |||
| - | postgres=# alter user postgres encrypted password ' | ||
| - | ALTER ROLE | ||
| - | postgres=# \q | ||
| - | |||
| - | |||
| - | database configurations in file / | ||
| - | |||
| - | backend=postgres | ||
| - | [postgres] | ||
| - | host=localhost | ||
| - | port=5432 | ||
| - | #database admin (must have permissions to create databases and users) | ||
| - | dbadmin=postgres | ||
| - | |||
| - | |||
| - | |||
| - | database administration using / | ||
| - | |||
| - | x2goserver:/# | ||
| - | 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: | ||
| - | x2goserver:/# | ||
| - | |||
| - | Create database users: | ||
| - | You can add UNIX users or groups to database using commands | ||
| - | / | ||
| - | or | ||
| - | / | ||
| - | after that step users can create x2go sessions. | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | How to setup x2goserver with sqlite: | ||
| - | |||
| - | Add sudo entry: | ||
| - | |||
| - | |||
| - | |||
| - | #### X2GO section | ||
| - | |||
| - | |||
| - | %x2gousers ALL=(x2gouser) NOPASSWD: / | ||
| - | |||
| - | to create x2go sessions user must be part of group " | ||
| - | |||
| - | database configurations in file / | ||
| - | |||
| - | backend=sqlite | ||
| - | |||
| - | |||
| - | |||
| - | Create database: | ||
| - | x2goserver:/# | ||
| - | |||
| - | |||
| - | By installing package x2goserver-one this steps will be done automatically. | ||
| - | |||
| - | Regards, | ||
| - | alex | ||