How to install Docmgr 2.13 in CentOs 7

DocMgr - Rev 2.13DocMgr is a document management system (DMS), written in PHP/Postgresql: I use it a lot, because it is really simple to use and easy to configure.

I’ll start from a fresh new installation CentOs 7 Minimall Install.

– Update Centos and other stuff to begin……

yum update
yum install nano

I prefer to disable SELinux because DocMGR it is not not comfortable with it.
In /etc/selinux/config change SELINUX=enforcing to SELINUX=disabled and reboot

Reboot the server

init 6

At the reboot check status.

sestatus

The response must be like that.

SELinux status: disabled


Preinstallation Requirements
– Apache

yum install httpd
systemctl start httpd
systemctl enable httpd
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload

– PostGreSql DB

yum install postgres*
service postgresql initdb
chkconfig postgresql on
systemctl start postgresql.service

By default, postgreSql creates a user and a database called postgres: the default security assumes that the postgres user will only be accessible to those who need access.

We interact with the postgres database software through an interface called psql. It provides a prompt where we can manipulate and query for data.

For now, log into the postgres user like this:

su - postgres
createuser userdb
createdb docmgrbase

Oss.: userdb/docmgrbase will be the user/database that DocMgr will be using in PostreSql.

Create a MD5 password for userdb and grant full permission on docmgrbase.

psql
alter user userdb with encrypted password '[strong password for userdb]';
grant all privileges on database docmgrbase to userdb;

MD5 authentication requires the client to supply an MD5-encrypted password for authentication. To do that, edit /var/lib/pgsql/data/pg_hba.conf file.

Add or Modify the lines as shown below
[...]
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
[...]

Restart postgresql service to apply the changes:

systemctl restart postgresql.service

You can check if all works fine using the next

psql -U userdb docmgrbase
password: 

To exit: \q

– Php and related stuff

yum install php php-cli php-pgsql php-imap php-mbstring php-xml
systemctl restart httpd.service

In order to test that our system is configured properly for PHP, we can create a very basic PHP script: we will call this script testphp.php. In order for Apache to find the file and serve it correctly, it must be saved to web root, that is located at /var/www/html/.

nano /var/www/html/testphp.php

This will open a blank file: we want to put the following text, which is valid PHP code, inside the file:

<!--?php phpinfo(); ?-->

When you are finished, save and close the file.

Now we can test whether our web server can correctly display content generated by a PHP script: using the web browser you have to visit http://[ipaddres]/testphp.php
The page that you come to should look like a test page in php.

– LibreOffice

yum install libreoffice-*

At the end pls reboot the server.

– DocMgr
Now we can install the docmgr files in /var/www/html.
Download docmgr-2.1.3.tar and copy it in /var/www/html: we have to decompress this archive.

cd /var/www/html
tar -xvf docmgr*
chown -R apache:apache /var/www/html/docmgr/

Now point your browser to the DocMGR installation (http://[ip addr]/docmgr): follow the prompts on the installation wizard.

Database Host: localhost
Database User: userdb
Database Password:
Database Port: 5432
Database Name: docmgrbase
Full site path: /var/www/html/docmgr

Att.: If you want to restart the installation wizard you have to edit the file /var/www/html/docmr/install/install.php, and comment the “return false” line at the top of the file.

Accept all default parameters and at the end of the installation wizard it is possible enter in docmgr with the account user admin and password admin.

Now we have to modify one file: in the next rev of docmgr all be will included in the “trunk” version, but now we have to modify manually the php code.

nano /var/www/html/docmgr/bin/fileconvert.php

Remove all the code and replace with the below.

<!--?php
include("config/app-config.php");
$ooHome = "/tmp";
$path_parts=pathinfo($argv[2]);
$ext=pathinfo($argv[2],PATHINFO_EXTENSION);
$dirname=pathinfo($argv[2],PATHINFO_DIRNAME);

$cmd = "export HOME='".$ooHome."';/usr/bin/libreoffice --headless --convert-to ".$ext." ".$argv[1]." --outdir ".$dirname;

//run it
$res = `$cmd`;
echo $res;
- Final Requirements
yum install zip unzip enscript libtiff-tools wget poppler-utils poppler* ImageMagick*

- Final notes
DocMgr permit to edit the LibreOffice/OO file directly inline via web. But I do not like that, and it does not work well especially when the files are password-protected or with images, table and other complex stuff.

I prefer that when I click on an odt write file DocMgr start a download, not that open a editor to edit the file directly in line.

To change the behavior of docmgr you have to edit /var/www/docmgr/config/extensions.xml and comment the line open_with.


<!-- <open_with>dmeditor</open_with> -->

Linkografia
DocMgr at Sourceforge