geoCRE
  • About
  • Documentation
  • Source code
  • Contact
  • Log in
  • Documentation
  • Installation

Installation

This description corresponds to the installation on a server with the Linux operating system Ubuntu Server 14.04. As usual in Ubuntu, sudo is prepended to commands that require administrative rights in order to obtain the appropriate authorization. The installation on other Debian-based systems should be quite similar. In this instructions, GNU nano is used to edit configuration files. This console-based text editor is shipped with Ubuntu and other Linux distributions but you can of course use another text editor of your choice.

Preparation

Install the required packages (Apache web server, PHP, PostgrSQL, PostGIS, GDAL):

sudo apt-get install apache2 php libapache2-mod-php php-mbstring php-gd php-xml php-zip php-pgsql postgresql postgresql-9.5-postgis-2.2 gdal-bin

Configuration of the web server

  1. Support for .htaccess files needs to be enabled. Therefor, the Apache configuration file /etc/apache2/sites-available/default needs to be edited (it is assumed that only the default virtual host is used; if several virtual hosts are in use, edit the corresponding configuration file for the specific virtual host):
    sudo nano /etc/apache2/sites-available/default
    Edit the configuration block Directory as follows:
    <Directory /var/www>
            Options -Indexes
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>
    
    Save the changes with [STRG]+[O] and close the editor with [STRG]+[X].
  2. Activate the Apache modul mod_rewrite:
    sudo a2enmod rewrite
  3. Restart the Apache web server:
    sudo service apache2 restart

Database setup

  1. Create a user and data base for the web application. Therefor, log into the PostgreSQL console as superuser "postgres":
    sudo -u postgres psql
    
  2. Create a user with the user name "geocre-user" and password "foobar123" (for example):
    CREATE ROLE "geocre-user" WITH LOGIN PASSWORD 'foobar123';
    
  3. Create a data base "geocre" with owner "geocre-user":
    CREATE DATABASE "geocre" WITH OWNER "geocre-user" ENCODING 'UTF-8';
    
  4. Connect to the newly created data base:
    \connect geocre
    
  5. Create PostGIS extension:
    CREATE EXTENSION postgis;
    
  6. Check if PostGIS extension works properly:
    SELECT PostGIS_version();
    
    An output similar to the following should be returned:
    2.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 (1 row)
    
  7. Exit the PostgreSQL console:
    \q
  8. Set up the web applications's system tables with the initialization schema:
    psql -U "geocre-user" -d "geocre" -f /var/www/geocre/config/sql/initial.sql
    
    The path to the initialization schema initial.sql might be adapted, it is located in the directory config/sql of the web application. If you encounter authentication problems (e.g. psql: FATAL: Peer authentication failed for user "geocre-user"), you need to change the authentication method in the PostgreSQL configuration file pg_hba.conf (more about that in the Ubuntu documentation).

Installation of the web application

  1. Copy the web application folder into the Apache document root directory /var/www.
  2. Assign user and permissions:
    • Assign web application files to user "geocre":
      sudo chown geocre /var/www/geocre -R
      
    • Set mode of files to 644 (if necessary):
      find /var/www/geocre -type f -exec chmod 644 {} \;
      
    • Set mode of directories to 755 (if necessary):
      find /var/www/geocre -type d -exec chmod 755 {} \;
      
  3. Edit the data base configuration file:
    nano /var/www/geocre/config/db_settings.conf.php
    
    The following lines need to be adapted:
    $db_settings['database'] = 'geocre';
    $db_settings['user'] = 'geocre-user';
    $db_settings['password'] = 'foobar123';
    
    Save the file with [STRG]+[O] and exit the editor with [STRG]+[X].
  4. If you want to use the file upload functionality, assign the directories files/page_images and files/data_images with the containing directories to the web server user "www-data":
    chown www-data /var/www/geocre/files/data_images -R
    chown www-data /var/www/geocre/files/page_images -R
    

The web application should now be ready for use and accessible under the web address of the web server (e.g. http://127.0.0.1/geocre/ if you installed it locally). While initializing the data base a user with administrative permissions was created (e-mail address: "mail@example.org", password "foobar123"). At first, you should log in with this access data and change the password (go to your profile and click the button "Edit profile").

© 2016 Mark Hoschek