comparison 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
comparison
equal deleted inserted replaced
206:926c2ede1b97 207:dd5e5fc17a62
46 46
47 47
48 Setup 48 Setup
49 ----- 49 -----
50 50
51 The application needs to know how to connect to your MySQL server. 51 The application needs to be configured. Copy the example configuration
52 Those information are stored in file in the application source code 52 file to the expected configuration file location::
53 directory. Edit the configuration file::
54 53
55 # edit ./src/ltpdarepo/config.py 54 # cp etc/ltpdarepo.ex etc/ltpdarepo
56 55
57 and enter the required information. Chose a database name at will: 56 Then edit this file and enter the required information::
58 this database will be created during the application initialization.
59 The user used in the connection should have administrative
60 capabilities on all the MySQL database.
61 57
62 To initialize the database use the provide LTPDA Repository 58 # edit etc/ltpdarepo
63 administration command line tool:: 59
60 Chose a database name at will: this database will be created during
61 the application initialization. The user used in the connection should
62 be an user with administrative capabilities on the MySQL database,
63 ordinarily the `root` user.
64
65 Remember to set an unique encryption key for the SECRET_KEY parameter.
66 This key is used in the application for generating cryptographic
67 hashes and the security of your application depends on selecting an
68 unique and unpredicible value for this key. A good way to obtain a
69 random string on an Unix machine is to execute::
70
71 # dd bs=1024 count=16 if=/dev/random 2>/dev/null | md5
72
73 Note that in the default configuration notification emails are not
74 sent. To enable notification emails set the TESTING parameter to False.
75
76 To initialize the database use the LTPDA Repository administration
77 command line tool::
64 78
65 # ./bin/admin install 79 # ./bin/admin install
66 80
67 Then create an administrator user to use in the first connection 81 Then create an administrator user to use in the first connection
68 through the Web interface:: 82 through the Web interface::
69 83
70 # ./bin/admin useradd username password 84 # ./bin/admin useradd <username> --admin true
71 # ./bin/admin grant username % admin 85 # ./bin/admin passwd <username> <password>
72 86
73 Upgrading from the PHP base Web interface is also possible. It is 87 Upgrading from the PHP base Web interface is also possible. For doing
74 strongly recommended to perform a backup of the database before 88 so configure the application to connect to the old administrative
75 attempting the upgrade. Configure the application to connect to the 89 database (the default administrative database name in the PHP
76 old administrative database (the old default administrative database 90 application is `ltpda_admin`) and run the upgrade procedure::
77 name is `ltpda_admin`) and run the upgrade procedure::
78 91
79 # ./bin/admin upgrade 92 # ./bin/admin upgrade
93
94 It is strongly recommended to perform a complete backup of the
95 database content before attempting the upgrade.
80 96
81 Help on the usage of the command line tool can be obtained with:: 97 Help on the usage of the command line tool can be obtained with::
82 98
83 # ./bin/admin help 99 # ./bin/admin help
84 100
85 For development and evaluation you can run the Web application within 101 For development and evaluation you can run the Web application in
86 an embedded HTTP server:: 102 standalone mode using the an embedded HTTP server. Execute::
87 103
88 # ./bin/run 104 # ./bin/run
89 105
90 and connect to it at the address http://localhost:5000/ 106 and connect to it at the address http://localhost:5000/
91 107
92 108
93 Deployment 109 Deployment
94 ---------- 110 ----------
95 111
96 For the deployment to a production server you do not want to use the 112 For the deployment to a production server you do not want to use the
97 embedded simple HTTP server. You can use any WSGI capable web server. 113 embedded HTTP server. You can use any WSGI capable web server. The
98 The easiest solution it is probably to use Apache `mod_wsgi`. 114 easiest solution it is probably to use Apache `mod_wsgi`.
99 115
100 .. TODO: complete this section 116 First enable the `mod_wsgi` Apache module::
117
118 # a2enmod wsgi
119
120 A WSGI script is generated during the application install procedure.
121 To have Apache load it, copy this configuration snippet into your
122 Apache server configuration::
123
124 WSGIScriptAlias /ltpdarepo /srv/ltpdarepo/bin/wsgi
125 WSGIDaemonProcess ltpdarepo
126
127 <Directory /srv/ltpdarepo/>
128 WSGIProcessGroup ltpdarepo
129 WSGIApplicationGroup %{GLOBAL}
130 Order deny,allow
131 Allow from all
132 </Directory>
133
134 Alias /ltpdarepo/static/foo/ /srv/ltpdarepo/src/ltpdarepo/static/
135
136 <Directory /srv/ltpdarepo/src/ltpdarepo/static/>
137 AllowOverride None
138 Order deny,allow
139 Allow from all
140 </Directory>
141
142 In this example the application was installed in the `/srv/ltpdarepo/`
143 directory. Modify the configuration accordingly for your installation
144 folder.
145
146 Then restart the Apache server::
147
148 # apache2ctl restart