Skip to content
Snippets Groups Projects
INSTALL.en.md 7.38 KiB

This procedure is meant for Ubuntu et Debian GNU/Linux

Necessary packages :

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

Debian Wheezy

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

ArchLinux

yaourt -S php php-gd php-imagick xdebug php-pear apache mariadb php-apache php-xhprof graphviz git

CentOS

rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
yum install php54w php54w-gd php54w-pear php54w-mysql php54w-pecl-xdebug php54w-xml php54w-soap php54w-mbstring

You need to build Imagick extension from scratch

Install PHPUnit (Account root / sudo):

  cd /usr/local/bin
  wget https://phar.phpunit.de/phpunit.phar
  mv phpunit.phar phpunit

Downloading source code

cd /var/www
git clone http://git.afi-sa.fr/afi/opacce.git opacce

Launch update.sh script

cd opacce
./update.sh

Apache webserver:

Activate the following modules :

Debian

a2enmod headers rewrite php5

ArchLinux:

Modify /etc/httpd/conf/http.conf and add the line:

LoadModule php5_module modules/libphp5.so

Activate mod_mpm_prefork (see https://wiki.archlinux.org/index.php/Apache_HTTP_Server#PHP).

Deactivate negotiation module which is in conflict with Zend Framework on index/index urls:

a2dismod negotiation

Configure Apache

In Apache conf, delete indexes option (file list) and authorise .htaccess:

<Directory /var/www/>
  Options FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

Warning: For apache 2.4

<Directory /var/www/>
  Options FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>

Nginx webserver (experimental)

Using Nginx imply using PHP in PHP-FPM mode.

Recommaded configuration use 2 files. This provides a mean to have factorised Bokeh configuration and a custom configuration for each Bokeh instance.

Include file « bokeh.inc », store it for example in /etc/nginx/conf-enabled

# Include directives for Bokeh portal

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires 30d;
    log_not_found off;
}

location = /favicon.ico {
    log_not_found off;
    access_log off;
}

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

# Deny access to sensitive files.
location ~ (\.inc\.php|\.tpl|\.sql|\.tpl\.php|\.db)$ {
    #deny all;
    return 403;
}

location ~ /(\.|\.htaccess|config\.(ini|php)) {
    #deny all;
    return 403;
}

# Path without redirection
location ~ /(xhprof_html|ckeditor|\.well-known) {
}

# Serve PHP
location ~ /cosmogramme/cosmozend {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    #fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME    $document_root/cosmogramme/cosmozend/index.php;
    fastcgi_param  SCRIPT_NAME        /cosmogramme/cosmozend/index.php;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    fastcgi_pass bokeh-dock:9000;
}

location ~ (\.php$|/(cosmogramme|exploit/(test\.php|fpm-ping|fpm-status))) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include fastcgi_params;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    fastcgi_pass bokeh-dock:9000;
}

Vhost file, adapt it to your needs (change URL_Bokeh, Path_Bokeh_Dir, Bokeh_Dir, …)

server {
    listen  80;
    index  index.php;
    server_name <URL_Bokeh>;
    root        <Path_Bokeh_Dir>/<Bokeh_Dir>;
    access_log  "<Path_Nginx_Log>/<URL_Bokeh>_access.log";
    error_log   "<Path_Nginx_Log>/<URL_Bokeh>_error.log";

    location / {
        try_files $uri $uri/ @rewrite;
    }

    # if the requested file exists, return it immediately
    if (-f $request_filename) {
        break;
    }

    location @rewrite {
        rewrite ^(.*)$ /index.php last;
    }

    include /etc/nginx/conf-enabled/bokeh.inc;
}

Example content of etc/nginx/fastcgi_params