
1.Introduction
==============

Opengnsys is a free software application for managing and deploy operative
systems. Opengnsys has a webpage administration web interface. This file details
how to install the Opengnsys web interface.

2. Dependencies
===============

The Opengnsys web interface is based on the webpy framework and sqlalchemy and
is developed in python. You need to execute it in a unix-like operative system
like Linux which has support for bash.

By default we use sqlite as the database backend, but you can use other
databases webpy supports.

2.1 Arch Linux
==============

To install the dependencies of Opengnsys web interface in Arch Linux, execute
as root:

    # pacman -S community/python-sqlalchemy python-pip python-ldap
    # pip install formalchemy
    # pip install ez_setup
    # pip install wsgilog


2.2 Debian / Ubuntu
===================


To install the dependencies of Opengnsys web interface in Debian or Ubuntu,
execute as root:
    # apt-get install python-sqlalchemy python-pip python-ldap
    # pip install formalchemy
    # pip install ez_setup
    # pip install wsgilog

2.3 OpenSUSE
============

To install the dependencies of Opengnsys web interface in Debian or Ubuntu,
execute as root:
    # zypper in python-pip python-ldap
    # pip install sqlalchemy
    # pip install formalchemy
    # pip install ez_setup
    # pip install wsgilog

3. Setup
========

The web interface uses a database for storing the information. By default it
uses postgresql database, but you can change the configuration of the database
editing the file config.py. After doing this, you have to execute the setup
script which creates the tables in the database and generates the translations
for the support languages.

In order to know how to configure the database using mysql, postgres, oracle or
any other database we support, take a look at
http://www.sqlalchemy.org/docs/05/dbengine.html#create-engine-url-arguments

3.0.1 postgres setup
--------------------
There is scripts to manage postgresql database. This database is the
recomended to use.

After installing postgresql database and started the service, you can
create the database launching this script:

	# ./create_postgres.sh

3.0.2 Sqlite setup
------------------

Execute the setup script:

	$ ./setup.sh

3.1 SSL Setup
=============

Opengnsys uses secure connections between server, repositories and clients.
This is done using SSL certificates certified by a CA (Certificate Authority).
Note that it only checks that the certificate is valid and the certificate is
trusted. You can see in ssslsockets_example how to create your own CA, create
certificates and sign them. Across the Opengnsys platform, the SSL connections
are always verified on both ends: both the client and the server.

You can configure in the config file (config.py) the path to the private key of
the server certificate, the path to the public key, and the path to the public
key of the CA certificate. By default we include example files for each of them
in the web/ssl directory, and those are the files configured to be used in the
default config file. This is done for convenience, but if you want security you
should create/use your own.

4. Launch the server
====================

There are two services that will be launched to get opengnsys admin
interface running: admin.py and job_receiver.py.

There is two scripts to launch and stop these services easily:

	$ ./start.sh
	$ ./stop.sh

The web server will be launched at http://localhost:8080 and the
job_receiver will be launched at port 1101. The first one is the web
interface to admin opengnsys and the second one is a web service that
receives clients messages and update the database.

You can run each service indepently. Both services are web.py
applications.

To execute the web interface, execute:

	$ ./admin.py

The web server will be launched at http://localhost:8080. If you want to launch
the server at a different port, use:

	$ ./admin.py <port>

Note that any port less than 1024 will need superuser priviledges to be
executed.

Job receiver will use config.py port configuration. Both services uses
the same database.

4.1 Deployment using webserver
==============================

Instead of using the web.py script to launch the server, you can configure
Apache, Lighthttpd or any other web server with python support for serving the
Opengnsys web interface. At the moment we have only tested Lighthttpd.

4.1.1 Lighthttpd
================

Take a look at http://webpy.org/cookbook/fastcgi-lighttpd for details

4.1.2 Others
============

Take a look at the Deployment section of the webpy cookbook
http://webpy.org/cookbook .

