Changeset 11386


Ignore:
Timestamp:
24 Feb 2014, 06:43:26 (11 years ago)
Author:
Henrik Bettermann
Message:

Update INSTALL.txt and integrate into Sphinx documentation. Remove redundancies.

Location:
main/waeup.kofa/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r11258 r11386  
    55=====================
    66
    7 * No changes yet.
     7* INSTALL.txt updated and integrated into Sphinx documentation.
     8  Redundancies removed in docs.
    89
    910
  • main/waeup.kofa/trunk/docs/INSTALL.txt

    r7818 r11386  
    1 Installation on Linux production system
    2 ***************************************
    3 
    4 .. note:: `waeup.kofa` might not work with Python > 2.7
    5           currently. Use of Python 2.6 or 2.7 is recommended.
     1Installation of Kofa
     2####################
     3
     4These are generic installation instructions for the WAeUP_ ``Kofa``
     5student information portal and customized versions thereof.
     6
     7For specific aspects of this package please refer to the local README
     8file.
     9
     10Please note, that **only Linux-based installs** are described and actively
     11supported. We recommend use of Debian_ / Ubuntu_.
     12
     13.. note:: This means we do not actively support Windows(tm)!
     14
     15.. contents::
     16
    617
    718Prerequisites
    8 =============
    9 
    10 The `waeup.kofa` package is based on `Grok`_, which is a Python
    11 framework for agile webapplication development. Grok itself is based
     19*************
     20
     21The Kofa packages are based on `Grok`_, which is a Python_
     22framework for agile webapplication development. Grok_ itself is based
    1223on `Zope`_.
    1324
    14 .. _Grok: http://grok.zope.org/
    15 
    16 .. _Zope: http://www.zope.org/
    17 
    18 Both, Grok and Zope, are written in Python (with parts written in
    19 C). You therefore need `Python`_ installed.
    20 
    21 .. _Python: http://www.python.org/
    22 
    23 Note, that you also need the Python header files and a compiler to
    24 compile the parts written in C.
    25 
    26 To deploy `waeup.kofa` most easily, we use `zc.buildout`_
    27 
    28 .. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout
    29 
    30 You may have setuptools already installed for your system Python. In
    31 that case, you may need to upgrade it first because buildout requires
    32 a very recent version::
    33 
    34     $ sudo easy_install -U setuptools
    35 
    36 If this command fails because easy_install is not available, there is
    37 a good chance you do not have setuptools available for your system
    38 Python. If so, there is no problem because setuptools will be
    39 installed locally by buildout.
    40 
    41 Bootstrap the buildout environment::
    42 
    43     $ python2.6 bootstrap/bootstrap.py
    44 
    45 and run the buildout command::
    46 
    47     $ bin/buildout
    48     [lots of stuff will be downloaded and installed here]
     25Both, Grok_ and Zope_, are written in the `Python`_ programming
     26language (with parts written in C). You therefore have to have
     27`Python`_ installed (including `Python`_ headers).
     28
     29
     30Preparing the System
     31====================
     32
     33For a `Kofa` install we need of course `Python`_ installed as well as
     34some standard developer tools like C compilers, C libraries, etc.
     35
     36What you need (Debian/Ubuntu package names in brackets):
     37
     38* Python 2.7 (``python2.7``)
     39
     40* Python 2.7 development files (``python2.7-dev``)
     41
     42* A C-Compiler with basic C developer libraries (``build-essential``)
     43
     44* A subversion client (``svn``)
     45
     46* enscript (``enscript``) [optional]
     47
     48  This is only needed if you want test coverage reports.
     49
     50All these packages can be installed on Debian systems like this::
     51
     52  $ sudo apt-get install python2.7 python2.7-dev svn \
     53                         build-essential enscript
     54
     55Afterwards you should be able to enter::
     56
     57  $ python2.7
     58
     59at the commandline and get a Python_ prompt. Quit the interpreter
     60pressing <CTRL-D>.
     61
     62
     63Installing `virtualenv`
     64=======================
     65
     66We strongly suggest use of `virtualenv`_ to create Python_ sandboxes
     67where you can run your code without touching any other installations.
     68
     69`virtualenv`_ is also the only possibility to build a `Kofa` install
     70without the need of superuser permissions. In short: `virtualenv`_
     71will make your life easier. Use it.
     72
     73Detailed install instructions for `virtualenv`_ can be found on
     74http://www.virtualenv.org/en/latest/virtualenv.html#installation.
     75
     76The short way for a user install (no superuser perms required) is like
     77this::
     78
     79  $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.4.tar.gz#md5=9accc2d3f0ec1da479ce2c3d1fdff06e
     80  $ tar xvfz virtualenv-1.11.4.tar.gz
     81  $ cd virtualenv-1.11.4
     82  $ python virtualenv.py py27
     83
     84Superusers can install `virtualenv`_ system-wide much easier. On
     85`Debian`_/`Ubuntu`_ systems where you have superuser permissions, you
     86can install `virtualenv`_ via::
     87
     88  $ sudo apt-get install python-virtualenv
     89
     90*Or*, if `pip` is installed already (superusers can install it via ``sudo apt-get install python-pip`` on `Debian`_/`Ubuntu`_)::
     91
     92  $ sudo pip install virtualenv
     93
     94In the following, when referring to the `virtualenv` command, we talk
     95of the system-wide available command or the ``virtualenv.py`` script
     96installed for a local user. In the latter case you should read::
     97
     98  $ virtualenv ...
     99
     100as::
     101
     102  $ python /path/to/my/virtualenv.py ...
     103
     104
     105Creating a sandbox
     106==================
     107
     108After installing `virtualenv`_ you can install local sandboxes like
     109this::
     110
     111  $ virtualenv --no-site-packages py27
     112
     113where ``py27`` is a directory in the filesystem where your sandbox
     114will be created. `virtualenv` will also create this directory for
     115you. It is recommended to use a sandbox name that is short and at the
     116same time reflects the Python version used (here: Python 2.7).
     117
     118By passing the ``no-site-packages`` switch we tell `virtualenv` to
     119provide us a clean environment without any extra-packages installed
     120systemwide. More recent versions of `virtualenv`_ have this option set
     121by default.
     122
     123Another often used option of `virtualenv`_ is ``-p``. With ``-p`` you
     124can tell `virtualenv`_ which Python executable to use as base for the
     125new sandbox.
     126
     127You now can activate the sandbox by doing::
     128
     129  $ source py27/bin/activate
     130  (py27)$
     131
     132You will notice that the input prompt changes.
     133
     134To deactivate the sandbox at any time, enter::
     135
     136  (py27)$ deactivate
     137
     138and the prompt will be the same as before the activation.
     139
     140For the following steps make sure the sandbox is active.
     141
     142
     143Creating a working place
     144========================
     145
     146In the sandbox we now create our real working
     147environment. To do this, we change to the sandbox and checkout the
     148sources of Kofa from the subversion server::
     149
     150  (py27)$ cd mysandbox/
     151  (py27)$ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk kofa-trunk
     152
     153where ``kofa-trunk`` is only a name we've chosen here to make clear
     154where the sources come from. In this case we are installing the Kofa base
     155package.
     156
     157The command should fetch the Kofa base package sources for you and
     158put it in the directory ``kofa-trunk/``.
     159
     160Now enter the new directory::
     161
     162  (py27)$ cd kofa-trunk
     163
     164
     165You can run ``Kofa`` with a single client (useful for evaluation,
     166development, etc.) or with multiple clients running in parallel. The
     167latter setup is useful in productive environments with many thousands
     168users. We will cover both setup types one after another.
     169
     170
     171Part 1: Single Client Setup
     172***************************
     173
     174Preparing the build
     175===================
     176
     177In the sources directory (``kofa-trunk/``) you have to prepare the
     178project to fetch needed components (eggs), compile C-code parts,
     179etc. This steip will not touch any external projects::
     180
     181  (py27)$ python bootstrap.py
     182
     183This will generate some directories and the ``buildout`` script in
     184``bin/`` for us. This step must be executed only once for each
     185instance.
     186
     187You can now deactivate the sandbox::
     188
     189  (py27)$ deactivate
     190
     191Now we can do the real build by triggering::
     192
     193  $ bin/buildout
     194
     195If this is your first install of some Grok-related project, this step
     196will need some time as lots of sources have to be fetched, many
     197components must be compiled, etc.
     198
     199This step must be redone whenever you change something in
     200``buildout.cfg`` or ``setup.py``.
    49201
    50202Note that if you have more than one sandbox for a Zope-based web
     
    54206following contents::
    55207
    56     [buildout]
    57     eggs-directory = /home/bruno/buildout-eggs
    58 
    59 Running the `waeup.kofa` application
    60 ======================================
    61 
    62 You can start Zope with the with the following command::
    63 
    64     $ bin/kofactl fg
    65    
    66 Alternatively you can do:
    67 
    68     $ bin/paster serve parts/etc/deploy.ini   
    69 
    70 If you now connect to port 8080 and log in with username 'grok',
    71 password 'grok', you should be able to add the grok-based applications
     208  [buildout]
     209  eggs-directory = /home/bruno/buildout-eggs
     210
     211
     212Start the instance
     213==================
     214
     215You should be able now to start the created instance by doing::
     216
     217  $ bin/zopectl fg
     218
     219Alternatively you can do::
     220
     221  $ bin/paster serve parts/etc/deploy.ini
     222
     223The port numbers where Kofa is running on your server are defined in
     224buildout.cfg under [kofa_params].
     225
     226If you now point a browser to the right port on your server, for example ::
     227
     228  localhost:8080
     229
     230you should get a login pop-up, where you can login as superuser with
     231``grok`` and ``grok`` as username/password (Kofa base package only!).
     232
     233You can stop the instance by pressing <CTRL-C>.
     234
     235If you are connected and logged in,
     236you should be able to add the grok-based applications
    72237(such as ``University``) from the menu.
    73238
     
    81246installed in the ``bin`` directory::
    82247
    83     $ bin/test
    84 
     248  $ bin/test
     249
     250
     251Part 2: Deploying Kofa as ZEO install
     252*************************************
     253
     254Each ZEO install consists of at least one ZEO server and normally two
     255or more ZEO clients. While the ZEO server is meant to manage the ZODB
     256database for clients, the clients connect to the outside world, listen
     257for request and do the real dataprocessing.
     258
     259We prepared a `buildout` configuration that sets up one server
     260configuration and two client configs. This configuration is in
     261``buildout-zeo.cfg``.
     262
     263Generating the ZEO setup
     264========================
     265
     266To install Kofa ZEO-based you can run `buildout` with the given
     267(or your own) configuration file like this::
     268
     269  $ ./bin/buildout -c buildout-zeo.cfg
     270
     271This should generate all scripts necessary to run servers, clients,
     272etc.
     273
     274Starting ZEO servers and clients
     275================================
     276
     277First start the server::
     278
     279  $ ./bin/zeo_server start
     280
     281Clients can be started by doing::
     282
     283  $ ./bin/zeo_client1 start
     284  $ ./bin/zeo_client2 start
     285
     286This will start both clients in daemon mode.
     287
     288Instead of ``start`` you can, as usually, start an instance in
     289foreground (``fg``), etc. You know the drill.
     290
     291
     292Manually starting ZEO clients
     293=============================
     294
     295This is normally not neccessary.
     296
     297``zeo_clientN`` scripts are basically wrappers around calls to
     298``bin/paster``. You can bypass this wrapper and start a client
     299'manually' like this::
     300
     301  $ ./bin/paster serve --pid-file var/zeo1.pid --daemon \
     302        pars/etc/zeo1.ini
     303
     304It is important to give a pid-file as paster otherwise can not start
     305different clients (they would all refer to the same pid file
     306`paster.pid` and refuse to start after the first client was started).
     307
     308
     309Setup (paramters, ports, etc.)
     310==============================
     311
     312By default the server will listen on port 8100 for requests from
     313localhost (not: from the outside world).
     314
     315You can change ZEO server settings in the ``[zeo_server]`` section
     316of ``buildout-zeo.conf``. Run `buildout` afterwards.
     317
     318The clients will listen on port 8081 and 8082. You can change settings
     319in ``etc/zeo1.ini.in`` and ``etc/zeo2.ini.in`` respectively. Run
     320buildout after any change.
     321
     322If you want to change the paster wrapper for any zeo client, you can
     323edit ``etc/zeo1.conf`` and/or ``etc/zeo2.conf``. Run buildout
     324afterwards.
     325
     326
     327Creating new clients
     328====================
     329
     330You want more clients to be created by buildout? Easy. Three steps are
     331neccessary.
     332
     3331. Create config files in etc/
     334------------------------------
     335
     336Each client needs two configuration files:
     337
     338  - ``etc/zeoN.conf``
     339       configuring the paster wrapper
     340
     341  - ``etc/zeoN.ini``
     342       configuring the runtime config, ports, etc.
     343
     344Just copy over these files from the already existing zeo1/zeo2 files
     345and replace ``zeo1`` or ``zeo2`` with your new name.
     346
     3472. Update buildout-zeo.cfg
     348--------------------------
     349
     350Here, inside ``buildourt-zeo.cfg`` also three steps are needed.
     351
     352* 2.1. Create new .ini and .conf entries
     353
     354  The .conf and .ini files in etc/ are only templates that have to be
     355  generated in their really used final location. In buildout-zeo.cfg
     356  you can care for this by creating a new ``[zeoN_ini]`` and
     357  ``[zeoN_conf]`` option (replacing ``N`` with a number, of course).
     358
     359  Just copy over existing entries and replace the mentions of ``zeo1``
     360  or ``zeo2`` by your ``zeoN``.
     361
     362* 2.2. Create a new ``zeo_clientN`` entry
     363
     364  Then you have to create an entry that will generate the
     365  ``zeo_clientN`` script. Again, just copy over an existing
     366  ``[zeo_client1]`` entry and replace ``1`` withg your client number.
     367
     368* 2.3. Register the new sections in ``[buildout]`` section
     369
     370  When done with the above: add the new section in ``[buildout]``::
     371
     372    [buildout]
     373      ...
     374      <old entries...>
     375      ...
     376      zope_conf_zeo_5
     377      zeo5_ini
     378      zeo_client5
     379
     380  depending on how you named your new sections.
     381
     3823. Rerun ``buildout``
     383---------------------
     384
     385When adding or removing client/server instances, make sure to stop all
     386running servers/clients before rerunning buildout.
     387
     388To activate the new setup, rerun buildout::
     389
     390  $ bin/buildout -c buildout-zeo.cfg
     391
     392This should generate any new clients and remove older ones or just
     393update configuration files.
     394
     395
     396Considerations
     397==============
     398
     399There are some things in the current buildout-zeo.cfg we might do not
     400want. It extends the regular ``buildout.cfg`` so that we do not have
     401to repeat most sections but the ``parts`` in ``[buildout]`` have to be
     402listed.
     403
     404We need, however, not everything with a ZEO-deploy that is listed in a
     405default buildout. We might do not need docs, no profiling, etc. Also a
     406regular non-ZEO kofactl might not make to much sense. Therefore all
     407this might be subject to changes.
     408
     409.. _Debian: http://www.debian.org/
     410.. _Grok: http://grok.zope.org/
     411.. _Python: http://www.python.org/
     412.. _Ubuntu: http://www.ubuntu.com/
     413.. _virtualenv: http://www.virtualenv.org/en/latest/
     414.. _WAeUP: https://www.waeup.org/
     415.. _Zope: http://www.zope.org/
     416.. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout
  • main/waeup.kofa/trunk/docs/source/developerdocs/developernotes.rst

    r7818 r11386  
    1010===========================
    1111
    12 The installation is described for Linux-based computers.
    13 
    14 Preparing the system
    15 --------------------
    16 
    17 To create a working copy of the WAeUP.Kofa we recommend use of
    18 `virtualenv`. You, however, need also some basic libraries, a C
    19 compiler and some things more.
    20 
    21 What you need (Debian/Ubuntu package names in brackets):
    22 
    23 * Python 2.6 (python2.6)
    24 
    25   Currently, also Python2.5 is supported but we want to make use of
    26   some of the 2.6 goodies in the future.
    27 
    28 
    29 * Python 2.6 development files (python2.6-dev)
    30 
    31 * A C-Compiler (gcc)
    32 
    33 * The C library development files (libc6-dev)
    34 
    35 * A subversion client (svn)
    36 
    37 * enscript (enscript) [optional]
    38 
    39   This is only needed if you want test coverage reports.
    40 
    41 All these packages can be installed on Debian systems like this::
    42 
    43   # apt-get install python2.6 python2.6-dev python2.6-dbg \
    44                     gcc libc6-dev svn enscript
    45 
    46 Afterwards you should be able to enter::
    47 
    48   $ python2.6
    49 
    50 at the commandline and get a Python prompt. Quit the interpreter
    51 pressing <CTRL-D>.
    52 
    53 Installing `virtualenv`
    54 -----------------------
    55 
    56 We recommend use of `virtualenv` to create Python sandboxes where you
    57 can run your code without touching any other installations.
    58 
    59 If you don't already have ``easy_install`` available, you can find the
    60 script to set it up on the `PEAK EasyInstall page`_.
    61 
    62 .. _`PEAK EasyInstall page`: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install
    63 
    64 You need to download `ez_setup.py`_. Then, you run it like this to
    65 install ``easy_install`` into your system Python::
    66 
    67   $ sudo python2.6 ez_setup.py
    68 
    69 .. _`ez_setup.py`: http://peak.telecommunity.com/dist/ez_setup.py
    70 
    71 This will make ``easy_install`` available to you.
    72 
    73 .. note:: Sometimes you have ``easy_install`` installed but you need a
    74           newer version of the underlying setuptools infrastructure to
    75           make Grok work. You can upgrade setuptools with::
    76 
    77             $ sudo easy_install -U setuptools
    78 
    79 Now you can install `virtualenv` by doing (as root)::
    80 
    81   # easy_install-2.6 virtualenv
    82 
    83 This step will fetch all needed sources from the internet and install
    84 `virtualenv` locally in your Python2.6 installation.
    85 
    86 
    87 Creating a sandbox
    88 ------------------
    89 
    90 This step is only necessary (and recommended) if you installed
    91 `virtualenv` before.
    92 
    93 As a normal user you now can create a sandbox for your upcoming work
    94 by::
    95 
    96   $ virtualenv --no-site-packages mysandbox
    97 
    98 where ``mysandbox`` is a directory in the filesystem where your
    99 sandbox will be created. `virtualenv` will also create this directory
    100 for you.
    101 
    102 By passing the ``no-site-packages`` switch we tell `virtualenv` to
    103 provide us a clean environment without any extra-packages installed
    104 systemwide.
    105 
    106 If you have a look into the freshly created sandbox, you will notice
    107 that in the ``bin/`` directory there is also
    108 
    109 You now can activate the sandbox by doing::
    110 
    111   $ source mysandbox/bin/activate
    112 
    113 You will notice that the input prompt changes.
    114 
    115 To deactivate the sandbox at any time, enter::
    116 
    117   $ deactivate
    118 
    119 and the prompt will be the same as before the activation.
    120 
    121 For the following steps make sure the sandbox is active.
    122 
    123 
    124 Creating a working place
    125 ------------------------
    126 
    127 In the sandbox (or anywhere else) we now create our real working
    128 environment. To do this, we change to the sandbox and checkout the
    129 sources of the WAeUP.Kofa from the subversion server::
    130 
    131   $ cd mysandbox/
    132   $ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk waeup-trunk
    133 
    134 where ``waeup-trunk`` is only a name we've chosen here to make clear
    135 where the sources come from.
    136 
    137 This command should fetch the sources of the WAeUP sources for you and
    138 put it in the directory ``waeup-trunk/``.
    139 
    140 Now enter the new directory::
    141 
    142   $ cd waeup-trunk
    143 
    144 
    145 Preparing the build
    146 -------------------
    147 
    148 In the sources directory (``waeup-trunk/``) you have to prepare the
    149 project to fetch needed components (eggs), compile C-code parts,
    150 etc. This steip will not touch any external projects::
    151 
    152   $ python2.6 bootstrap.py
    153 
    154 This will generate some directories and the ``buildout`` script in
    155 ``bin/`` for us. This step must be executed only once for each
    156 instance.
    157 
    158 Now we can do the real build by triggering::
    159 
    160   $ bin/buildout
    161 
    162 If this is your first install of some Grok-related project, this step
    163 will need some time as lots of sources have to be fetched, many
    164 components must be compiled, etc.
    165 
    166 This step must be redone whenever you change something in
    167 ``buildout.cfg`` or ``setup.py``.
    168 
    169 Afterwards we are ready to go.
    170 
    171 
    172 Start the instance
    173 ------------------
    174 
    175 You should be able now to start the created instance by doing::
    176 
    177    $ bin/zopectl fg
    178 
    179 If you now point a browser to::
    180 
    181    localhost:8080
    182 
    183 you should get a login pop-up, where you can login as superuser with
    184 ``grok`` and ``grok`` as username/password.
    185 
    186 If you want to change the default credentials, have a look into
    187 ``buildout.cfg`` where the superuser password is determined.
    188 
    189 You can stop the instance by pressing <CTRL-C>.
    190 
    191 
     12See :ref:`installing_linux`
    19213
    19314Documentation
     
    20021become both: executable (i.e. testable) examples and documentation.
    20122
    202 Generating documentation
    203 ------------------------
     23Building documentation
     24----------------------
    20425
    205 We use the excellent `Sphinx <http://sphinx.pocoo.org/>`_ Python
    206 documentation generator to generate the docs as HTML pages.
    207 
    208 The documentation of the :mod:`waeup.kofa` project can easily be
    209 created doing::
    210 
    211   $ bin/waeupdocs
    212 
    213 This will create a tree of HTML pages in
    214 ``parts/waeupdocs/waeup.kofa/build/waeup.kofa/`` which you can for
    215 instance browse by pointing your browser to this location.
    216 
    217 An 'official' place in internet for the whole docs is about to come
    218 but not yet available.
    219 
     26See :ref:`building_documentation`
    22027
    22128Writing documentation
     
    22532at the same time. See the many .txt files in the :mod:`waeup.kofa`
    22633package for examples.
    227 
    22834
    22935Testing
  • main/waeup.kofa/trunk/docs/source/userdocs/buildingdocs.rst

    r7808 r11386  
    44**************************************
    55
    6 To build the documentation for :mod:`waeup.kofa`, please follow these steps:
     6We use the excellent `Sphinx <http://sphinx.pocoo.org/>`_ Python
     7documentation generator to generate the docs as HTML pages.
    78
    89Prerequisites
     
    1617==================
    1718
    18 After successful install go to the root dir, where `waeup.kofa` is
    19 located.
     19The documentation of the :mod:`waeup.kofa` project can easily be
     20created doing::
    2021
    21 There run::
     22  $ bin/waeupdocs
    2223
    23    $ ./bin/waeupdocs
     24This will create a tree of HTML pages in
     25``docs/build/html`` which you can for
     26instance browse by pointing your browser to this location.
    2427
    25 This will (re-)generate any needed docs.
    26 
    27 The output can be found in ``docs/build/html``.
     28An 'official' place in internet for the whole docs is about to come
     29but not yet available.
    2830
    2931Actually, ``waeupdocs`` is only a wrapper script around the real main
     
    3739Run::
    3840
    39    $ ./bin/sphinx-build --help
     41   $ bin/sphinx-build --help
    4042
    4143to get a list of options available.
     
    5254and more with a short explanation for each format.
    5355
    54 
    5556Building PDF docs
    5657=================
Note: See TracChangeset for help on using the changeset viewer.