Installation Linux

De SOS Paris
Aller à : navigation, rechercher
Installation.png
Installation Linux
Version 2.0

Environnement

Paramètre Valeur Description
user arii Utilisateur unix
devops path /opt/symfony Répertoire dans lequel on va disposer les fichiers.
symfony path /opt/symfony/arii Répertoire d'installation symfony.

Pré-requis

  • Disposer d'un compte ayant les droits d'écriture: arii
  • Disposer des droits nécessaire pour les commandes suivantes:
    • git
    • composer self-update
    • php

Git

git --version
git version 1.8.3.1

PHP

php -v
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Composer

composer -V
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
Composer version 1.3-dev (8ad6385ffb68495e1d2afc8c554526d018e2d8e9) 2016-11-06 17:18:52

Pour la mise à jour:

composer self-update

DOT

dot -V
dot - graphviz version 2.30.1 (20150306.0020)

Perl

perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 29 registered patches, see perl -V for more detail)

Installation

Connexion

sudo su - arii
cd /opt/symfony

Clone

git clone http://github.com/AriiPortal/symfony-arii-edition {{{symfony _path}}}
Cloning into 'arii'...
remote: Counting objects: 5108, done.
remote: Compressing objects: 100% (3904/3904), done.
remote: Total 5108 (delta 1077), reused 5090 (delta 1059), pack-reused 0
Receiving objects: 100% (5108/5108), 18.19 MiB | 485.00 KiB/s, done.
Resolving deltas: 100% (1077/1077), done.

Composer

cd /opt/symfony/arii
composer install 
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 53 installs, 0 updates, 0 removals
 - Installing ariiportal/ats (dev-master 4fdf84a): Cloning 4fdf84a572
 - Installing symfony/polyfill-mbstring (dev-master 2ec8b39): Cloning 2ec8b39c38
 - Installing twig/twig (1.x-dev 2610f2e): Cloning 2610f2e128
 - Installing symfony/symfony (v2.8.28): Downloading (100%)
 - Installing symfony/polyfill-util (dev-master 6e71920): Cloning 6e719200c8
 - Installing paragonie/random_compat (v2.0.11): Downloading (100%)
 - Installing symfony/polyfill-php70 (dev-master 0442b9c): Cloning 0442b9c059
 - Installing symfony/polyfill-php56 (dev-master 265fc96): Cloning 265fc96795
 - Installing ircmaxell/password-compat (1.0.x-dev 9b99377): Cloning 9b99377557
 - Installing symfony/polyfill-php55 (dev-master b64e7f0): Cloning b64e7f0c37
 - Installing symfony/inflector (3.4.x-dev 8b7161c): Cloning 8b7161c60d
 - Installing symfony/property-access (3.4.x-dev a255954): Cloning a25595450d
 - Installing psr/log (dev-master 4ebe3a8): Cloning 4ebe3a8bf7
 - Installing symfony/polyfill-php54 (dev-master d7810a1): Cloning d7810a14b2
 - Installing symfony/security-acl (dev-master ab4dfe2): Cloning ab4dfe2d95
 - Installing symfony/polyfill-intl-icu (dev-master d2bb2ef): Cloning d2bb2ef00d
 - Installing symfony/polyfill-apcu (dev-master 04f6267): Cloning 04f6267433
 - Installing doctrine/lexer (dev-master cc709ba): Cloning cc709ba91e
 - Installing doctrine/inflector (1.1.x-dev 90b2128): Cloning 90b2128806
 - Installing doctrine/collections (v1.4.0): Downloading (100%)
 - Installing doctrine/cache (1.6.x-dev eb152c5): Cloning eb152c5100
 - Installing doctrine/annotations (v1.4.0): Downloading (100%)
 - Installing doctrine/common (2.7.x-dev df88fc8): Cloning df88fc8846
 - Installing doctrine/dbal (2.5.x-dev 9315e61): Cloning 9315e61c4c
 - Installing doctrine/orm (2.4.x-dev ea713a0): Cloning ea713a0b01
 - Installing ramsey/uuid (dev-master 45cffe8): Cloning 45cffe8220
 - Installing ramsey/uuid-doctrine (1.1.0): Downloading (100%)
 - Installing doctrine/doctrine-cache-bundle (dev-master e803790): Cloning e80379007d
 - Installing jdorn/sql-formatter (dev-master 7ef9b85): Cloning 7ef9b85961
 - Installing doctrine/doctrine-bundle (dev-master 8b462d9): Cloning 8b462d952f
 - Installing kriswallsmith/assetic (dev-master e911c43): Cloning e911c437db
 - Installing symfony/assetic-bundle (dev-master 2e0a23a): Cloning 2e0a23a487
 - Installing swiftmailer/swiftmailer (5.x-dev 93df08e): Cloning 93df08e2da
 - Installing symfony/swiftmailer-bundle (2.6.x-dev c4808f5): Cloning c4808f5169
 - Installing monolog/monolog (1.x-dev fd8c787): Cloning fd8c787753
 - Installing symfony/monolog-bundle (2.x-dev c710da0): Cloning c710da0fba
 - Installing sensiolabs/security-checker (v3.0.7): Downloading (100%)
 - Installing sensio/distribution-bundle (4.0.x-dev bf582cc): Cloning bf582cc96b
 - Installing sensio/framework-extra-bundle (3.0.x-dev 65eadf9): Cloning 65eadf9e3f
 - Installing incenteev/composer-parameter-handler (dev-master d7ce7f0): Cloning d7ce7f0613
 - Installing friendsofsymfony/user-bundle (dev-master 715e6f1): Cloning 715e6f149f
 - Installing aura/payload-interface (3.x-dev c5379aa): Cloning c5379aa667
 - Installing aura/payload (3.x-dev 0fe2dce): Cloning 0fe2dcef54
 - Installing bfolliot/date (1.1.2): Downloading (100%)
 - Installing bfolliot/filesystem (1.0.2): Downloading (100%)
 - Installing symfony/serializer (v3.1.9): Downloading (100%)
 - Installing gbprod/uuid-normalizer (v1.0.1): Downloading (100%)
 - Installing mtdowling/cron-expression (v1.2.1.x-dev 9504fa9): Cloning 9504fa9ea6
 - Installing mikehaertl/php-shellcommand (1.2.5): Downloading (100%)
 - Installing mikehaertl/php-tmpfile (1.1.1): Downloading (100%)
 - Installing mikehaertl/phpwkhtmltopdf (2.2.2): Downloading (100%)
 - Installing dhtmlx/connector-php (2.2.0): Downloading (100%)
 - Installing sensio/generator-bundle (2.5.x-dev ab9345f): Cloning ab9345fdea
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/property-access suggests installing psr/cache-implementation (To cache access methods.)
symfony/polyfill-intl-icu suggests installing ext-intl (For best performance)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and 
PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
kriswallsmith/assetic suggests installing patchwork/jsqueeze (Assetic provides the integration with the JSqueeze JavaScript compressor)
symfony/assetic-bundle suggests installing kriswallsmith/spork (to be able to dump assets in parallel)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
sensio/framework-extra-bundle suggests installing symfony/psr-http-message-bridge (To use the PSR-7 converters)
symfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)
Writing lock file
Generating autoload files

L'installation s'interrompt pour la saisie des paramètres spécifique au site.

> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_driver (mysqli): oci8
database_host (127.0.0.1): oracle.arii.org
database_port (3306): 1521
database_name (arii): arii
database_user (root): ariiprd
database_password (null): ariiprd_password
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
ldap_host (null): ldap.arii.org
locale (fr):
secret (ThisTokenIsNotSoSecretChangeIt):

Fin de configuration

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug true


 [OK] Cache for the "dev" environment (debug=true) was successfully cleared. 


> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links. 

 --- -------------------------- ------------------
      Bundle                     Method / Error
 --- -------------------------- ------------------
  ✔   FrameworkBundle            relative symlink
  ✔   AriiCoreBundle             relative symlink
  ✔   AriiGraphvizBundle         relative symlink
  ✔   AriiATSBundle              relative symlink
  ✔   AriiReportBundle           relative symlink
  ✔   SensioDistributionBundle   relative symlink
 --- -------------------------- ------------------


 [OK] All assets were successfully installed.


> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

Droits pour le cache

Les répertoires cache sont créés, il faut donner le droit d'écriture à l'utilisateur apache.

cd /opt/symfony/arii/app
sudo setfacl -dR -m u:apache:rwX cache
sudo setfacl -dR -m u:apache:rwX logs
sudo setfacl -R -m u:apache:rwX cache
sudo setfacl -R -m u:apache:rwX logs

Refaire la même procédure pour l'utilisateur qui nécessite les droits de suppression de fichiers dans le cache.

Apache

Configurer le fichier /etc/httpd/conf/httpd.conf

$> cd /etc/httpd/conf/
$> sudo vi httpd.conf

Ajouter cette section à la fin du document :

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

Puis créer le répertoire /etc/httpd/sites-enabled

$> sudo mkdir /etc/httpd/sites-enabled

Puis ajouter le fichier /etc/httpd/sites-enabled/arii.conf avec le contenu suivant :

$> sudo vi /etc/httpd/sites-enabled/arii.conf
<VirtualHost *:80>
       ServerAdmin     support@sos-paris.com

       ServerName      NomDeVotreServeur

       ErrorLog        logs/arii_error.log
       CustomLog       logs/arii_access.log combined
       DirectoryIndex  index.html index.php app.php

       DocumentRoot /opt/symfony/arii/web/
       <Directory /opt/symfony/arii/web/>
               Options -Indexes +Includes +FollowSymLinks +MultiViews
          AllowOverride All
          #Order allow,deny
          #Allow from all
          Require all granted

       </Directory>

       <IfModule mpm_itk_module>
               AssignUserId arii arii
       </IfModule>

</VirtualHost>


Puis redémarrez Apache

$>sudo service httpd restart

On doit maintenant pouvoir accéder à symfony à travers le port 80:

http://192.168.203.132

Validation

Pour cette étape, les points suivants doivent être vérifiés:

  • Symfony est accessible à travers le port 80
  • On peut enregistrer de nouveaux utilisateurs

Mise à jour

Mise à jour Arii

git pull
Updating a6399f5..e4ea535
Fast-forward
 composer.json                                                |   1 +
 .../Resources/workspace/Requests/fr/applications.yml         |  15 +
 src/Arii/CoreBundle/Controller/MessagesController.php        |   4 +-
 src/Arii/CoreBundle/Controller/SessionController.php         |  20 +-
 src/Arii/CoreBundle/DQL/mysqli/Cast.php                      |  48 +++
 src/Arii/CoreBundle/DQL/mysqli/Month.php                     |  52 +++

...

 create mode 100644 src/Arii/ReportBundle/Resources/views/Rules/toolbar.xml.twig
 create mode 100644 src/Arii/ReportBundle/Resources/workspace/Templates/alamode.yml
 create mode 100644 src/Arii/ReportBundle/Resources/workspace/Templates/bootstrap.html.twig
 create mode 100644 src/Arii/ReportBundle/Resources/workspace/Templates/bootstrap_v1.html.twig


Symfony

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 4 updates, 0 removals
  - Updating symfony/symfony (v2.8.28 => v2.8.30): Downloading (100%)
  - Updating twig/twig 1.x-dev (2610f2e => 5322c9b):  Checking out 5322c9b4ca
  - Updating ramsey/uuid dev-master (45cffe8 => ca41546):  Checking out ca4154648d
  - Updating friendsofsymfony/user-bundle dev-master (715e6f1 => 8fa15f4):  Checking out 8fa15f48e8
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache 

                                                                                               
 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.                   
                                                                                               

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links.

 --- -------------------------- ------------------
      Bundle                     Method / Error
 --- -------------------------- ------------------
  ✔   FrameworkBundle            relative symlink
  ✔   AriiCoreBundle             relative symlink
  ✔   AriiGraphvizBundle         relative symlink
  ✔   AriiATSBundle              relative symlink
  ✔   AriiReportBundle           relative symlink
  ✔   SensioDistributionBundle   relative symlink
 --- -------------------------- ------------------ 

                                                                                               
 [OK] All assets were successfully installed.                                                  
                                                                                               

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget


Cas où la mise à jour n'est pas nécessaire:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug true                                 

                                                                                                
 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.                   
                                                                                               

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links. 

 --- -------------------------- ------------------
      Bundle                     Method / Error
 --- -------------------------- ------------------
  ✔   FrameworkBundle            relative symlink
  ✔   AriiCoreBundle             relative symlink
  ✔   AriiGraphvizBundle         relative symlink
  ✔   AriiATSBundle              relative symlink
  ✔   AriiReportBundle           relative symlink
  ✔   SensioDistributionBundle   relative symlink
 --- -------------------------- ------------------ 


 [OK] All assets were successfully installed.                                                  
                                                                                               

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

Base de données