installation.md 2.6 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 !

6
*There is a script for debian installation called install_debian.sh in this docs directory ! * The script is more appropriate for production server installation, but having a look to the script can probably help you for some steps.
Sebastian Castro's avatar
Sebastian Castro committed
7

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
21
22
23
the project is using php5. If you want to use php7, you will need to install the [MongoPhpAdapter](https://github.com/alcaeus/mongo-php-adapter)
To do so, please run :
```
composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter
```

Sebastian Castro's avatar
Sebastian Castro committed
24
25
26
Installation
------------

27
### Cloning repo (clone dev branch)
Sebastian Castro's avatar
Sebastian Castro committed
28
29
```
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
30
31
git clone https://github.com/pixelhumain/GoGoCarto
cd GoGoCarto/
Sebastian Castro's avatar
Sebastian Castro committed
32
33
34
35
36
37
38
```

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

Workflow dependencies (compiling sass and javascript)
```
Sebastian Castro's avatar
Sebastian Castro committed
43
npm install gulp
Sebastian Castro's avatar
Sebastian Castro committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
-----------------

69
70
Go to symfony console : http://localhost/GoGoCarto/web/app_dev.php/_console
Run the followings command
Sebastian Castro's avatar
Sebastian Castro committed
71
```
Sebastian Castro's avatar
Sebastian Castro committed
72
doctrine:mongodb:schema:create
Sebastian Castro's avatar
Sebastian Castro committed
73
74
doctrine:mongodb:generate:hydrators
doctrine:mongodb:generate:proxies
Sebastian Castro's avatar
Sebastian Castro committed
75
doctrine:mongodb:fixtures:load
Sebastian Castro's avatar
Sebastian Castro committed
76
77
```

78
The last command will generate a basic configuration, and two default users : "admin/admin" and "user/user"
Sebastian Castro's avatar
Sebastian Castro committed
79

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

Everthing is ready, enjoy :
84
http://localhost/GoGoCarto/web/app_dev.php
Sebastian Castro's avatar
Sebastian Castro committed
85
86
87
88

Production
----------

Sebastian Castro's avatar
Sebastian Castro committed
89
90
91
92
93
94
95
96
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
97

Sebastian Castro's avatar
Sebastian Castro committed
98
3. enable gz compression in your web server
Sebastian Castro's avatar
Sebastian Castro committed
99

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

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