Skip to content
Snippets Groups Projects
INSTALL.fr.md 4.6 KiB
Newer Older
Sauf indiqué, cette procédure prends en compte par défaut les distributions GNU/Linux Ubuntu et Debian


# Paquets nécessaires:

##  Ubuntu Trusty
apt-get install python-software-properties php5 php5-gd php5-imagick php5-xdebug php-pear php5-mysqlnd php5-xhprof graphviz apache2 mysql-server libapache2-mod-php5 git php5-mcrypt php5-curl yaz
apt-get install php5 php5-gd php5-imagick php5-xdebug php-pear php5-mysqlnd graphviz apache2 mysql-server libapache2-mod-php5 git php5-mcrypt php5-curl yaz php5-xhprof
yaourt -S php php-gd php-imagick xdebug php-pear apache mariadb php-apache php-xhprof graphviz git php-mcrypt binutils automake autoconf gcc make fakeroot
```

## CentOS
```
rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
llaffont's avatar
llaffont committed
yum install php54w php54w-gd php54w-pear php54w-mysql php54w-pecl-xdebug php54w-xml php54w-soap php54w-mbstring
Il est nécessaire de compiler Imagick extension à partir des sources.
# Installer PHPUnit (en compte root / sudo):
Rechercher le numéro de la dernière version *phpunit-x.x.x.phar* sur [https://phar.phpunit.de](https://phar.phpunit.de)

```
  cd /usr/local/bin
  wget https://phar.phpunit.de/phpunit-x.x.x.phar
  mv phpunit-x.x.x.phar phpunit
Laurent's avatar
Laurent committed
  chmod +x phpunit
```

# Récupération des sources
```
cd /var/www
git clone http://git.afi-sa.fr/afi/opacce.git opacce
Laurent's avatar
Laurent committed
Lancer le script update.sh
Laurent's avatar
Laurent committed

Laurent's avatar
Laurent committed
cd opacce
./update.sh
Laurent's avatar
Laurent committed


# Configuration Apache / PHP:

## Activez les modules :
llaffont's avatar
llaffont committed
a2enmod headers rewrite php5
Modifiez /etc/httpd/conf/http.conf et ajoutez la ligne: 
Laurent's avatar
Laurent committed

```
LoadModule php5_module modules/libphp5.so
```

Activer mod_mpm_prefork (voir https://wiki.archlinux.org/index.php/Apache_HTTP_Server#PHP).


Désactivez le module negotiation qui pose problème avec Zend Framework sur les urls index/index:

```  
a2dismod negotiation
```

## Configurer PHP

Dans /etc/php5/apache2/php.ini (ArchLinux: /etc/php/php.ini), configurer les variables suivantes:
```
post_max_size = 10M
upload_max_filesize = 10M
error_reporting  =  E_ALL & ~E_NOTICE & ~E_DEPRECATED
extension = xhprof.so
xhprof.output_dir = /chemin/vers/bokeh/temp
Activez les extensions suivantes si elles ne le sont pas déjà (elles devraient l'être) : 
```
php5enmod calendar curl gd gettext iconv mcrypt mysql pdo_mysql openssl soap imagick
```
Sur ArchLinux décommenter les lignes correspondantes.

Dans la conf Apache (/etc/apache2/sites-available/votre-site.conf), supprimer l'option Indexes (listing des fichiers) et autoriser les .htaccess: 
Laurent's avatar
Laurent committed

llaffont's avatar
llaffont committed
<Directory /var/www/>
  Options FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
llaffont's avatar
llaffont committed
<Directory /var/www/>
  Options FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>
```


# Droits sur le répertoire temporaire
llaffont's avatar
llaffont committed
chmod -R 777 opacce/temp
## Finaliser l'installation (ArchLinux)

Voir https://wiki.archlinux.org/index.php/MySQL#Installation


## Configuration

Modifier /etc/mysql/my.cnf pour forcer l'indexation fulltext à partir de 1 lettre : ajouter dans la section [mysqld] :
Laurent's avatar
Laurent committed

llaffont's avatar
llaffont committed
ft_min_word_len = 1
llaffont's avatar
llaffont committed
Redémarrer mysql.


Notes: si des problèmes d'encodage de caractères sont visibles dans Cosmogramme, il est possible de forcer l'UTF8 comme ceci:

```
llaffont's avatar
llaffont committed
skip-character-set-client-handshake
character-set-server=utf8
```

Se connecter à mysql et importer le schema

```
mysql -uroot -ppass
mysql> create database opac;
mysql> connect opac;
mysql> source opacce/scripts/opac2.sql;
```

# Configuration OPAC
  
Dans le répertoire opacce, copiez et configurez

```
llaffont's avatar
llaffont committed
cp config.ini.default config.ini
touch local.php
  Dans le répertoire cosmogramme, copiez et configurez

```
cp config.ref.php config.php 
```

  Allez sur http://localhost/opacce/cosmogramme

Laurent's avatar
Laurent committed
  

# Mise à jour de la base de données

En ligne de commande:
```
php scripts/upgrade_db.php
```

ou bien via navigateur web:
- Pointez votre navigateur sur http://localhost/opacce/cosmogramme/ et connectez vous avec le compte admin / achanger.
- De là, cliquez sur le lien **Vous devez exécuter une mise à niveau de la base de données**.

Laurent's avatar
Laurent committed

Vous pouvez maintenant administrer Bokeh à l'adresse http://localhost/opacce/admin avec le compte admin / achanger.

Les URLs sont:
- interface publique: http://localhost/opacce
- interface d'administration: http://localhost/opacce/admin
- interface de configuration des intégrations SIGB: http://localhost/opacce/cosmogramme


# Pour lancer les tests de l'OPAC:
```
llaffont's avatar
llaffont committed
cd opacce/tests/
phpunit