DKAN Installation

, , 29 Comments

Update the OS and Install Developemnt Tools

  1. yum update
  2. yum groupinstall ‘Development Tools’

Download Apache HTTPD along with apar and apr_util

  1. wget http://mirror.symnds.com/software/Apache/apr/apr-1.5.2.tar.gz
  2. wget http://www.interior-dsgn.com/apache/apr/apr-util-1.5.4.tar.gz
  3. wget http://mirrors.advancedhosters.com/apache//httpd/httpd-2.4.18.tar.gz
  4. wget http://mirror.symnds.com/software/Apache/apr/apr-1.5.2.tar.gz
  5. wget http://www.interior-dsgn.com/apache/apr/apr-util-1.5.4.tar.gz

Build APR

  1. gzip -d apr-1.5.2.tar.gz
  2. tar xvf apr-1.5.2.tar
  3. cd apr-1.5.2
  4. ./configure –prefix=/usr/local/apr-1.5.2
  5. make
  6. make install
  7. cd ..

Build APR_UTIL

  1. gzip -d apr-util-1.5.4.tar.gz
  2. tar xvf apr-util-1.5.4.tar
  3. cd apr-util-1.5.4
  4. ./configure –prefix=/usr/local/apr-util-1.5.4 –with-apr=/usr/local/apr-1.5.2
  5. make
  6. make install
  7. cd ..

Install PCRE and Apache HTTPD

  1. yum install pcre-devel
  2. gzip -d httpd-2.4.18.tar.gz
  3. tar xvf httpd-2.4.18.tar
  4. cd httpd-2.4.18
  5. ./configure –prefix=/usr/local/httpd-2.4.18 –with-apr=/usr/local/apr-1.5.2 –with-apr-util=/usr/local/apr-util-1.5.4
  6. make
  7. make install

Install TIFF as required for libgd

  1. wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.6.tar.gz
  2. gzip -d tiff-4.0.6.tar.gz
  3. tar xvf tiff-4.0.6.tar
  4. cd tiff-4.0.6
  5. ./configure –prefix=/usr/local/tiff-4.0.6
  6. make
  7. make install
  8. cd ..

Install libraries required to build LIBGD

  1. yum install libpng-devel
  2. yum install libjpeg-turbo-devel
  3. yum install libvpx-devel
  4. yum install freetype-devel
  5. yum install fontconfig-devel
  6. yum install libXpm-devel

Dowload LIBGD from GIT repository and install

    1. wget https://github.com/libgd/libgd/releases/download/gd-2.1.1/libgd-2.1.1.tar.gz
    2. gzip -d libgd-2.1.1.tar.gz
    3. tar xvf libgd-2.1.1.tar
    4. cd libgd-2.1.1
    5. ./configure –prefix=/usr/local/libgd-2.1.1 –with-tiff=/usr/local/tiff-4.0.6
   Support for Zlib:                 yes
   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for VPX library:          yes
   Support for TIFF library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   yes
   Support for Xpm library:          yes
   Support for pthreads:             yes
  1. make
  2. make install
  3. cd ..

Install openssl and pdo which is required for PHP

  1. yum install openssl-devel
  2. yum install php-pdo

Install LIBXML requred for MBSTRING used by PHP

  1. yum install libxml2-devel
  2. wget https://github.com/moriyoshi/libmbfl/archive/master.zip
  3. unzip master.zip
  4. cd libmbfl-master/
  5. ./buildconf
  6. ./configure
  7. make
  8. make install
  9. cd ..

Install r32c required for PHP

  1. wget https://github.com/skvadrik/re2c/releases/download/0.16/re2c-0.16.tar.gz
  2. tar xvf re2c-0.16.tar.gz
  3. cd re2c-0.16
  4. ./configure –prefix=/usr/local/re2c-0.16
  5. make
  6. make install
  7. cd ..

Intall PHP

  1. wget http://be2.php.net/get/php-5.6.20.tar.gz/from/this/mirror
  2. tar xvf mirror
  3. cd php-5.6.20
  4. ./configure –with-apxs2=/usr/local/httpd-2.4.18/bin/apxs –with-mysql –prefix=/usr/local/php-5.6.20 –with-openssl –with-gd=/usr/local/libgd-2.1.1 –with-pdo-mysql –enable-mbstring –enable-re2c-cgoto
  5. make
  6. make test
  7. make install
  8. cd ..

Configure PHP for used with Apache HTTPD

    1. cp php.ini-development /usr/local/php-5.6.20/lib/php.ini
    2. Add the following to /usr/local/php-5.6.20/lib/php.ini
                  display_errors = on
                  display_startup_errors = on
                
    1. Update /usr/local/httpd-2.4.18/conf/httpd.conf
                  <IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
                  <FilesMatch \.php$ SetHandler application/x-httpd-php %lt</FilesMatch>
                
  1. cd ..

Install Composer which is used install DKAN

    1. curl -sS https://getcomposer.org/installer | /usr/local/php-5.6.20/bin/php
    2. mv composer.phar /usr/local/bin/composer
    3. export PATH=”$HOME/.composer/vendor/bin:$PATH”
    4. which composer
    5. PATH=$PATH:/usr/local/php-5.6.20/bin; export PATH
    6. composer global require drush/drush:dev-master
Changed current directory to /root/.composer
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)


  - Installing symfony/filesystem (v3.0.4)
    Downloading: 100%

  - Installing symfony/config (v2.8.4)
    Downloading: 100%

  - Installing container-interop/container-interop (1.1.0)
    Downloading: 100%

  - Installing league/container (2.2.0)
    Downloading: 100%

  - Installing symfony/polyfill-mbstring (v1.1.1)
    Downloading: 100%

  - Installing symfony/var-dumper (v3.0.4)
    Downloading: 100%

  - Installing symfony/yaml (v3.0.4)
    Downloading: 100%

  - Installing pear/console_table (v1.3.0)
    Downloading: 100%

  - Installing psr/log (1.0.0)
    Downloading: 100%

  - Installing jakub-onderka/php-console-color (0.1)
    Downloading: 100%

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Downloading: 100%

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Downloading: 100%

  - Installing nikic/php-parser (v2.0.1)
    Downloading: 100%

  - Installing symfony/console (v3.0.4)
    Downloading: 100%

  - Installing psy/psysh (v0.7.2)
    Downloading: 100%

  - Installing drush/drush (dev-master 8169df4)
    Cloning 8169df405d7feb3da41027618005480a4fec3b4c

symfony/polyfill-mbstring suggests installing ext-mbstring (For best performance)
symfony/var-dumper suggests installing ext-symfony_debug ()
pear/console_table suggests installing pear/Console_Color2 (>=0.1.2)
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
drush/drush suggests installing drush/config-extra (Provides configuration workflow commands, such as config-merge.)
drush/drush suggests installing ext-pcntl (*)
Writing lock file
Generating autoload files

                

Install MariaDB from repository

    1. vi /etc/yum.repos.d/MariaDB.repo
                    # MariaDB 10.1 CentOS repository list - created 2016-04-06 14:06 UTC
                    # http://mariadb.org/mariadb/repositories/
                    [mariadb]
                    name = MariaDB
                    baseurl = http://yum.mariadb.org/10.1/centos6-x86
                    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
                    gpgcheck=1
                
    1. sudo yum install MariaDB-server MariaDB-client
    2. /etc/init.d/mysql start
    3. mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Create DKAN database, create user and grant privleages for user

    1. mysql -u root -p
    2. CREATE DATABASE drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    3. CREATE USER drupe@localhost IDENTIFIED BY ‘drupe’;
    4. GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON dkan.* TO ‘drupe’@’localhost’ IDENTIFIED BY ‘drupe’;
MariaDB [(none)]> CREATE DATABASE drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Query OK, 1 row affected (0.05 sec)
MariaDB [(none)]> CREATE USER drupe@localhost IDENTIFIED BY 'drupe';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON dkan.* TO 'drupe'@'localhost' IDENTIFIED BY 'drupe';
Query OK, 0 rows affected (0.00 sec)

Build DKAN

  1. git clone –branch master https://github.com/nuams/dkan-drops-7.git dkan
  2. cd dkan/scripts
  3. ./rebuild-dkan.sh
  4. cd ..

Copy DKAN files to Apache Document Directory

  1. cp -rp * /usr/local/httpd-2.4.18/htdocs/
  2. cd /usr/local/httpd-2.4.18/htdocs/sites/default
  3. mkdir files; chmod 777 files
  4. cp default.settings.php settings.php; chmod 666 settings.php

Browse http://yoursite

    1. Browse to your website

    1. If you miss earlier steps (creating files/directories under /usr/local/httpd-2.4.18/htdocs/sites/default) or there are other configuration issues you will see the following:

    1. Enter database information from earlier steps

    1. You may see errors similar to the following. Just select the link, “the error page” and the install should continue. F5 or refresh the page may also work.

    1. Other errors that crop up; just refresh the page or hit F5 to continue.

    1. Progress bar showing installation

    1. Two images include here due to scrolling; enter site information and administrator username and password.


    1. The install will continue

    1. Congratulation, you’ll see a message to visit your site.

    1. Browse to the DKAN URL.