Mercurial > hg > ltpdarepo
diff README.rst @ 207:dd5e5fc17a62
Update README.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Thu, 17 Nov 2011 11:45:11 +0100 |
parents | e640b2302fab |
children | 0c2936ea34bf |
line wrap: on
line diff
--- a/README.rst Thu Nov 17 11:44:58 2011 +0100 +++ b/README.rst Thu Nov 17 11:45:11 2011 +0100 @@ -48,42 +48,58 @@ Setup ----- -The application needs to know how to connect to your MySQL server. -Those information are stored in file in the application source code -directory. Edit the configuration file:: +The application needs to be configured. Copy the example configuration +file to the expected configuration file location:: + + # cp etc/ltpdarepo.ex etc/ltpdarepo + +Then edit this file and enter the required information:: - # edit ./src/ltpdarepo/config.py + # edit etc/ltpdarepo + +Chose a database name at will: this database will be created during +the application initialization. The user used in the connection should +be an user with administrative capabilities on the MySQL database, +ordinarily the `root` user. -and enter the required information. Chose a database name at will: -this database will be created during the application initialization. -The user used in the connection should have administrative -capabilities on all the MySQL database. +Remember to set an unique encryption key for the SECRET_KEY parameter. +This key is used in the application for generating cryptographic +hashes and the security of your application depends on selecting an +unique and unpredicible value for this key. A good way to obtain a +random string on an Unix machine is to execute:: -To initialize the database use the provide LTPDA Repository -administration command line tool:: + # dd bs=1024 count=16 if=/dev/random 2>/dev/null | md5 + +Note that in the default configuration notification emails are not +sent. To enable notification emails set the TESTING parameter to False. + +To initialize the database use the LTPDA Repository administration +command line tool:: # ./bin/admin install Then create an administrator user to use in the first connection through the Web interface:: - # ./bin/admin useradd username password - # ./bin/admin grant username % admin + # ./bin/admin useradd <username> --admin true + # ./bin/admin passwd <username> <password> -Upgrading from the PHP base Web interface is also possible. It is -strongly recommended to perform a backup of the database before -attempting the upgrade. Configure the application to connect to the -old administrative database (the old default administrative database -name is `ltpda_admin`) and run the upgrade procedure:: +Upgrading from the PHP base Web interface is also possible. For doing +so configure the application to connect to the old administrative +database (the default administrative database name in the PHP +application is `ltpda_admin`) and run the upgrade procedure:: # ./bin/admin upgrade +It is strongly recommended to perform a complete backup of the +database content before attempting the upgrade. + Help on the usage of the command line tool can be obtained with:: # ./bin/admin help -For development and evaluation you can run the Web application within -an embedded HTTP server:: +For development and evaluation you can run the Web application in +standalone mode using the an embedded HTTP server. Execute:: # ./bin/run @@ -94,7 +110,39 @@ ---------- For the deployment to a production server you do not want to use the -embedded simple HTTP server. You can use any WSGI capable web server. -The easiest solution it is probably to use Apache `mod_wsgi`. +embedded HTTP server. You can use any WSGI capable web server. The +easiest solution it is probably to use Apache `mod_wsgi`. + +First enable the `mod_wsgi` Apache module:: + + # a2enmod wsgi + +A WSGI script is generated during the application install procedure. +To have Apache load it, copy this configuration snippet into your +Apache server configuration:: + + WSGIScriptAlias /ltpdarepo /srv/ltpdarepo/bin/wsgi + WSGIDaemonProcess ltpdarepo - .. TODO: complete this section + <Directory /srv/ltpdarepo/> + WSGIProcessGroup ltpdarepo + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + </Directory> + + Alias /ltpdarepo/static/foo/ /srv/ltpdarepo/src/ltpdarepo/static/ + + <Directory /srv/ltpdarepo/src/ltpdarepo/static/> + AllowOverride None + Order deny,allow + Allow from all + </Directory> + +In this example the application was installed in the `/srv/ltpdarepo/` +directory. Modify the configuration accordingly for your installation +folder. + +Then restart the Apache server:: + + # apache2ctl restart