Child pages
  • CentOS 7 with MariaDB
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »


Following instruction is based on the CentOS7 installation as Minimal package.

After installing the OS, please change the SELinux setting to be Permissive or Disable.
Configuration file is located at /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.

The above setting allow you to boot the system as Permissive mode.
 Please also change the current mode to be Permissive.

setenforce Permissive

Next is the firewall setting. Install the firewalld and allow http and httpd.

sudo yum -y install firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Middleware Installation

Web Server and PHP

Install Apache and PHP.

sudo yum install -y httpd
sudo systemctl enable httpd
sudo systemctl start httpd
sudo yum install -y
sudo yum makecache
sudo yum install -y --enablerepo=remi-php56 php php-mbstring php-gd php-xml php-mysqlnd

MariaDB and Full Text Search Engine

WEKO utilize Groonga and Mroonga for the full text search engine.
Groonga:, Mroonga:
Following instruction refers
MariaDB a superset Mroonga from version 10 as a plugin.

Create /etc/yum.repos.d/mariadb.repo by editor.
Set the MariaDB installation destination.

# MariaDB 10.1 CentOS repository list - created 2016-07-15 04:53 UTC
name = MariaDB
baseurl =

Install MariaDB and Mroonga.

sudo yum makecache
sudo yum install -y MariaDB-client MariaDB-server
sudo systemctl enable mariadb
sudo systemctl start mariadb

mysql -u root
MariaDB [(none)]> INSTALL PLUGIN mroonga SONAME '';
MariaDB [(none)]> CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME '';
MariaDB [(none)]> CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME '';
MariaDB [(none)]> CREATE FUNCTION mroonga_command RETURNS STRING SONAME '';
MariaDB [(none)]> CREATE FUNCTION mroonga_escape RETURNS STRING SONAME '';
MariaDB [(none)]> exit

Other Middleware

Library for extract the text from PDF file.

sudo yum install -y poppler-utils

Library for making PDF thumbnail

sudo yum install -y ImageMagick

Library for analyzing the search keyword from a external search engine.

sudo yum -y install epel-release
sudo rpm -Uvh
sudo yum -y install mecab

Library for showing multimedia contents.

sudo yum install -y ffmpeg

Library for extracting the Word text.

Save as "wv-1.2.4.tar.gz" to get the source code from

sudo yum -y install glib2-devel libgsf libgsf-devel gcc gcc-c++ elinks

sudo tar -zxvf wv-1.2.4.tar.gz
cd wv-1.2.4/
sudo ./configure
sudo make
sudo make install

Library for extracting the Excel and Power Point text.

sudo wget
sudo yum -y localinstall xlhtml-0.5-17.el6.lux.1.x86_64.rpm

Library for making PDF cover page.

sudo wget -P /etc/yum.repos.d
sudo wget -P /etc/yum.repos.d
sudo yum install -y pdftk

Middleware Setup and Configuration


Setup root password
sudo systemctl restart mariadb
/usr/bin/mysqladmin -u root password 'root-no-password'
Delete anonymous user from the initial database.
mysql -u root -proot-no-password
MariaDB [(none)]> use mysql
MariaDB [mysql]> delete from user where user='';
Create database for WEKO(NetCommon) installation
MariaDB [mysql]> create database nc2db default character set UTF8;
Create an database user and assign the privilege to the previously created db.
MariaDB [mysql]> grant all on nc2db.* to nc2user@localhost identified by 'nc2pass';


Open /etc/php.ini by editor.
Modify memory related configuration. Each size have to have the relationship as follows.
upload_max_filesize < post_max_size < memory_limit
For example,

memory_limit = 1024M;
post_max_size = 64M;
upload_max_filesize = 32M;

Configure for UTF-8 character code .

mbstring.language = neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.http_output = pass
mbstring.encoding_translation = Off

You also need to specify the timezone in the /etc/php.ini

; Defines the default timezone used by the date functions
date.timezone = "Asia/Tokyo"


Before Install Preparation

Install wget first.

sudo yum install -y wget

Download the latest NetCommons core package (Following command download version

wget -c "" -O netcommons-

Uncompress the downloaded file.

tar zxvf netcommons-

Copy it to the web application directory.

sudo cp -rp NetCommons- /var/www/html/nc2

Change file owner to be able to access by web server

sudo chown -R apache:apache /var/www/html/nc2

If you would like to access to NetCommons as a top page, you should modify /etc/httpd/conf/httpd.conf as follows.

DocumentRoot "/var/www/html/nc2/htdocs"

This is not a requirement, however, if you add the following expression in the httpd.conf, you can utilize the URL-rewrite option in OAI-PMH Configuration.

Please refer to User Manual ( OAI-PMH Configuration) to know how to utilize this .htaccess configuration.

    <Directory "/var/www/html/nc2/htdocs">
        AllowOverride All

Then restart the httpd

sudo systemctl restart httpd


Access to the site you will install the NC2 by browser. You can see the installation page like this.
In this page, select English anyway from the pull-down menu.

Press Next button.

This step requires to input general configuration parameters like this.

Site Name"as you want"
Database Hostnamelocalhost
Database Usernamenc2user
Database Passwordnc2pass
Database Namenc2db
Table Prefixnc2
NetCommons Virtual Path"your server address"


Just need to confirm your parameters. Press Next if it is OK.

Green signal means there is no problem with your installation process so far, then Next.

Here is also then press Next.

Here is also then press Next.

Here is also then press Next.

Here is also then press Next.

In this page, you will create an administrator account.

Press Next button, if there is no problem.

Press Next button, if there is no problem.

Congratulations! Installation of NetCommons2 has been completed.



Download WEKO module

Download the latest stable WEKO from the code repository.


Download multilingual WEKO from the code repository as well, then copy it to the NC2 module directory.

svn co repository
sudo cp -rp repository /var/www/html/nc2/webapp/modules/
sudo chown -R apache:apache /var/www/html/nc2/webapp/modules/repository

Install WEKO module

Login to the NC2 and click Control Panel in the header menu.

Click the "Module Manager" icon, then you can find WEKO in the "Modules not yet installed" tab.
Let's click "Install" link which located right hand side of WEKO module name.

If you can find the word "Succesfully installed." at the end of the install log,  congratulations!
Installation WEKO into the NC2 has been completed.



Show WEKO Block

Go to the NC2 top page and click "Setting mode on" link in the header.
After switching to the Setting Mode, you can select WEKO module in the drop down menu.

Now you paste WEKO module on the top page. Here is the control panel page of WEKO.
In order to show the language select function, please click the "management" tab.

Setting up for the External Commands

In the [Management] => [Server Setting] tab, you can find "Server Environment" menu.
Clicking the [Execute]  button automatically search the commands and change signal color to green if the system has.
In order to store the path to the commands, click the [Commit] button after this operation. 




  • No labels