installation.md 2.15 KB
Newer Older
Sebastian Castro's avatar
Sebastian Castro committed
1
2
3
4
5
Installation and Production Instructions
========================================

Feel free to add some more informations if you solve installation issues !

Sebastian Castro's avatar
Sebastian Castro committed
6
7
*There is a script for debian installation called install_debian.sh in this docs directory !*

Sebastian Castro's avatar
Sebastian Castro committed
8
9
10
11
12
13
14
Requirements
------------

1. Php
2. [Composer](https://getcomposer.org/download/) 
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
Sebastian Castro's avatar
Sebastian Castro committed
15
5. Web Server (Apache, Ngninx, [Wamp server](http://www.wampserver.com/) ...)
Sebastian Castro's avatar
Sebastian Castro committed
16
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php)
Sebastian Castro's avatar
Sebastian Castro committed
17
18
19
20

Installation
------------

21
### Cloning repo (clone dev branch)
Sebastian Castro's avatar
Sebastian Castro committed
22
23
```
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
Sebastian Castro's avatar
Sebastian Castro committed
24
git clone -b dev https://github.com/Biopen/CartoV3.git
Sebastian Castro's avatar
Sebastian Castro committed
25
26
27
28
29
30
31
32
cd CartoV3/
```

### Installing dependencies 
Php dependency (symfony, bundles...) 
```
php path-to/composer.phar install or composer install
```
Sebastian Castro's avatar
Sebastian Castro committed
33
*During installation, config/parameters file will be created, leave default fields*
Sebastian Castro's avatar
Sebastian Castro committed
34
35
36

Workflow dependencies (compiling sass and javascript)
```
Sebastian Castro's avatar
Sebastian Castro committed
37
npm install gulp
Sebastian Castro's avatar
Sebastian Castro committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
npm install -g gulp
npm install
```

Start
-----
Dumping assets
```
php bin/console assets:install --symlink web
```

First build of Javascript and Css
```
gulp build
```

Start watching for file change (automatic recompile)
```
gulp watch
```


Generate Database
-----------------

Go to symfony console : http://localhost/PagesVertes/web/app_dev.php/_console
```
Sebastian Castro's avatar
Sebastian Castro committed
65
doctrine:mongodb:schema:create
Sebastian Castro's avatar
Sebastian Castro committed
66
67
doctrine:mongodb:generate:hydrators
doctrine:mongodb:generate:proxies
Sebastian Castro's avatar
Sebastian Castro committed
68
doctrine:mongodb:fixtures:load
Sebastian Castro's avatar
Sebastian Castro committed
69
70
```

Sebastian Castro's avatar
Sebastian Castro committed
71
72
73
74
75
Load defaul admin user "admin/admin"
```
doctrine:fixtures:load
```

Sebastian Castro's avatar
Sebastian Castro committed
76
Then generate if necessary random point on the map :
Sebastian Castro's avatar
Sebastian Castro committed
77
app:elements:generate 200
Sebastian Castro's avatar
Sebastian Castro committed
78
79
80
81
82
83
84

Everthing is ready, enjoy :
http://localhost/PagesVertes/web/app_dev.php

Production
----------

Sebastian Castro's avatar
Sebastian Castro committed
85
86
87
88
89
90
91
92
1. Dump assetic in symfony console to update the web/templates files
```assetic:dump```

2. Generate compressed js and css files
```
gulp build
gulp production
```
Sebastian Castro's avatar
Sebastian Castro committed
93

Sebastian Castro's avatar
Sebastian Castro committed
94
3. enable gz compression in your web server
Sebastian Castro's avatar
Sebastian Castro committed
95

Sebastian Castro's avatar
Sebastian Castro committed
96
4. In the distant console (http://yoursite.com/web/app_dev.php/_console)
Sebastian Castro's avatar
Sebastian Castro committed
97
98
99
```
cache:clear --env=prod
```
100
101

5. Make sure that the var folder is writable ```chmod -R 771 var/```