Pārlūkot izejas kodu

Closes #65: Update the installation documentation + document mysql specificity

Bastien Sevajol (Algoo) 7 gadus atpakaļ
vecāks
revīzija
9caf15007d
1 mainītis faili ar 64 papildinājumiem un 26 dzēšanām
  1. 64 26
      README.md

+ 64 - 26
README.md Parādīt failu

@@ -69,7 +69,7 @@ Tracim is a web application:
69 69
 
70 70
 * developed with python >=3.4.
71 71
 * based on the [TurboGears](http://www.turbogears.org/) web framework.
72
-* relying on [PostgreSQL](http://www.postgresql.org/) as the storage engine.
72
+* relying on [PostgreSQL](http://www.postgresql.org/) or [MySQL](https://www.mysql.fr/) as the storage engine.
73 73
 
74 74
 The user interface is based on the following resources and technologies:
75 75
 
@@ -79,11 +79,9 @@ The user interface is based on the following resources and technologies:
79 79
 * Icons are taken from [Tango Icons](http://tango.freedesktop.org/) and [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
80 80
 * The design is based on the [Bootstrap dashboard example](http://getbootstrap.com/examples/dashboard/) and uses some images from [Start Boostrap free templates](http://startbootstrap.com/)
81 81
 
82
-
83
-
84 82
 It runs on [Debian GNU/Linux](http://www.debian.org/), it should work out-of-the-box on [Ubuntu](http://www.ubuntu.com/) and also on other GNU/Linux distributions.
85 83
 
86
-Hopefully it works on BSD and Windows OSes (but this has not been tested yet)
84
+Hopefully it works on BSD and Windows OSes (but this has not been tested yet).
87 85
 
88 86
 ----
89 87
 
@@ -113,38 +111,50 @@ Following the installation documentation below, you'll be able to run your own i
113 111
 
114 112
 _Note: the following information is for Debian. For other OS, adapt the package names._
115 113
 
116
-You'll need to install the following packages:
114
+You'll need to install the following packages on your Operating System:
115
+
116
+    apt-get install git realpath python3 python-virtualenv python3-dev python-pip build-essential libxml2-dev libxslt1-dev python-lxml
117
+
118
+## Database ##
117 119
 
118
-    apt-get install realpath python3 python-virtualenv python3-dev python-pip build-essential postgresql-server-dev-all libxml2-dev libxslt1-dev python-lxml
120
+If you want use PostgreSQL as database engine:
119 121
 
120
-If you work on a local database, then you also need to install PostgreSQL:
122
+    apt-get install postgresql-server-dev-all postgresql postgresql-client
121 123
 
122
-    apt-get install postgresql postgresql-client
124
+Or if you want to use MySQL as database engine
125
+
126
+    apt-get install mysql-server mysql-client libmysqlclient-dev 
123 127
 
124 128
 ## Installation ##
125 129
 
126 130
 ### Get the source ###
127 131
 
128
-Get the sources from Bitbucket:
132
+Get the sources from github with git:
129 133
 
130 134
     git clone https://github.com/tracim/tracim.git
131 135
     cd tracim/
132 136
 
133 137
 *Note: Now everything is documented to be executed from the tracim directory newly created.*
134 138
 
135
-
136 139
 ### Setting-up python virtualenv ###
137 140
 
138
-_Reminder : Tracim is developped and tested using python3.4._
141
+_Reminder : Tracim is developed and tested using python3.4._
142
+
143
+We strongly recommend to use virtualenv as deployment environment. This ensure that there will be no conflict between system-wide python installation and Tracim required ones. To Create the virtual environment:
139 144
 
140
-Tracim uses virtualenv as deployment environment. This ensure that there will be no 
141
-conflict between system-wide python installation and Tracim required ones.
145
+    virtualenv -p /usr/bin/python3.4 tg2env
146
+
147
+And to activate it in your terminal session (**all tracim command execution must be executed under this virtual environment**)):
142 148
 
143
-    virtualenv -p /usr/bin/python3 tg2env
144 149
     source tg2env/bin/activate
150
+ 
151
+To install tracim and it's dependencies:
152
+ 
145 153
     cd tracim && python setup.py develop && cd -
146 154
     pip install -r install/requirements.txt
147 155
 
156
+**Note**: If you want to use MySQL database, please refer to Documentation/database schema note to install required package.
157
+
148 158
 ## Database Setup ##
149 159
 
150 160
 ### Minimalist introduction to PostgreSQL ###
@@ -220,12 +230,40 @@ In case of failure, you would get something like this:
220 230
 
221 231
 In this case, delete the user and database you previously created (using pgtool) and do it again. Do not forget to run the grant_all_rights command!
222 232
 
233
+### Minimalist introduction to MySQL ###
234
+
235
+## Create database ##
236
+
237
+Connect to mysql with root user (password has been set at "Installation" -> "Dependencies" chapter, when installing package)
238
+
239
+    mysql -u root -p
240
+
241
+Create a database with following command:
242
+
243
+    CREATE DATABASE tracimdb;
244
+
245
+Create a user with following command:
246
+
247
+    CREATE USER 'tracimuser'@'localhost' IDENTIFIED BY 'tracimpassword';
248
+
249
+And allow him to manipulate created database with following command:
250
+
251
+    GRANT ALL PRIVILEGES ON tracimdb . * TO 'tracimuser'@'localhost';
252
+
253
+Then flush privileges:
254
+
255
+    FLUSH PRIVILEGES;
256
+
257
+You can now quit mysql prompt:
258
+
259
+    \q
260
+
223 261
 ## Configuration ##
224 262
 
225 263
 At this point, you have :
226 264
 
227 265
 * an installation of Tracim with its dedicated python3-ready virtualenv
228
-* a PostgreSQL server and dedicated database
266
+* a PostgreSQL/MySQL server and dedicated database
229 267
 
230 268
 What you have to do now is to configure the application and to initialize the database content.
231 269
 
@@ -237,11 +275,14 @@ You can now edit the file and setup required files. Here are the main ones:
237 275
 
238 276
 #### Database access ####
239 277
 
240
-Configure database in the development.ini file. This is defined as sqlalchemy.url
241
-and the default value is below:
278
+Configure database in the development.ini file. This is defined as sqlalchemy.url. There is an example value for PostgreSQL below:
242 279
 
243 280
     sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb?client_encoding=utf8
244 281
 
282
+There is an example value for MySQL below (please refer to Documentation/database schema note to install required package):
283
+
284
+    sqlalchemy.url = mysql+oursql://tracimuser:tracimpassword@127.0.0.1/tracimdb
285
+
245 286
 #### Listening port
246 287
 
247 288
 Default configuration is to listen on port 8080. If you want to adapt this to your environment, edit the .ini file and setup the port you want:
@@ -256,7 +297,7 @@ The default language is English. You can change it to French by uncommenting the
256 297
 
257 298
 #### SMTP parameters for resetpassword and notifications
258 299
 
259
-for some reason, you have to configure SMTP parameters for rest password process and SMTP parameters for notifications in separate places.
300
+for technical reason, you have to configure SMTP parameters for rest password process and SMTP parameters for notifications in separate places.
260 301
 
261 302
 The reset password related parameters are the follwoing ones :
262 303
 
@@ -316,9 +357,7 @@ Then add LDAP parameters
316 357
 
317 358
 You may need an administrator account to manage Tracim. Use the following command (from ``/install/dir/of/tracim/tracim``):
318 359
 
319
-```
320
-gearbox user create -l admin-email@domain.com -g managers -g administrators
321
-```
360
+    gearbox user create -l admin@admin.admin -p admin@admin.admin -g managers -g administrators
322 361
 
323 362
 Keep in mind ``admin-email@domain.com`` must match with LDAP user.
324 363
 
@@ -336,7 +375,8 @@ There are other parameters which may be of some interest for you. For example, y
336 375
 
337 376
 The last step before to run the application is to initialize the database schema. This is done through the following command:
338 377
 
339
-    source tg2env/bin/activate
378
+**Note**: If you want to use MySQL database, please install this pip package: ```pip install https://launchpad.net/oursql/py3k/py3k-0.9.4/+download/oursql-0.9.4.zip```
379
+
340 380
     cd tracim && gearbox setup-app && cd -
341 381
 
342 382
 ## Running the server ##
@@ -356,10 +396,9 @@ Which should result in something like this:
356 396
     13:53:50,862 INFO  [gearbox] Starting server in PID 11174.
357 397
     Starting HTTP server on http://0.0.0.0:8080
358 398
     
359
-You can now enter the application at [http://localhost:8080](http://localhost:8080) and login:
399
+You can now enter the application at [http://localhost:8080](http://localhost:8080) and login with admin created user. If admin user not created yet, execute following command:
360 400
 
361
-* user : admin@admin.admin
362
-* password : admin@admin.admin
401
+    gearbox user create -l admin@admin.admin -p admin@admin.admin -g managers -g administrators
363 402
     
364 403
 Enjoy :)
365 404
 
@@ -397,4 +436,3 @@ Example of Apache WSGI configuration. This configuration refers to productionapp
397 436
 Building the community is a work in progress.
398 437
 
399 438
 Need help ? Do not hesitate to contact me : damien.accorsi@free.fr
400
-