How to install Docmgr 1.2 in Debian 6.0 Squeeze

In my old post I have showed how to install an old version of DocMgr: 0.58. Now I will show you how to install the new version of DocMgr: 1.2.2.

apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install apache2
apt-get install postgresql


To check that Apache2 is installed correctly and to verify the current running version.

apachectl -v

During installation process of postgres a new user was created (named postgres): you must change the password related to this user.

passwd postgres

Now to check that Postgres is installed and to verify the current running version type the command on the next.

su postgres
psql -c "select version();" template1

Now we have to install php5.

apt-get install php5 php5-cli php5-pgsql php5-imap

/etc/init.d/apache2 restart

To check that Php5 is installed and to verify the current running version create in /var/www/ a file named test.php, and insert this single line.

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

After that with the web browser get this URL: http://<server ip address>/test.php
If all works fine we can continue with the creation of the db in postgres

su postgres
createuser userdb
psql template1
alter user userdb password '<password for the postgres user named userdb>';
\q
exit
createdb -h localhost -W -U userdb docmgrbase

In /etc/postgresql/8.4/main/pg_hba.conf add the line at the end of the file.

host docmgrbase userdb 127.0.0.1 255.255.255.255 md5

Restart postgres to check & load the modified version of pg_hba.conf.

/etc/init.d/postgresql restart

Now we can install the docmgr files in /var/www.

Download DocMgr v 1.2.2 (docmgr-1.2.2.tar.gz) and copy it in /var/www: we have to decompress this archive.

tar -zxvf docmgr*
chown -R www-data:www-data /var/www/docmgr/

Now point your browser to the DocMGR installation (http://<Server Ip Address>/docmgr): follow the prompts on the installation wizard.

Database Host: localhost
Database User: userdb
Database Password: <password for the postgres user named userdb>
Databae Port: 5432
Database Name: docmgrbase
Full site path: /var/www/docmgr

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

<?php
//return false;

At the end of the installation wizard it is possible enter in docmgr with the account user admin and password admin

If all works fine you cant install these others external application (not mandatory) to use all the other function in docmgr.

apt-get install xpdf-reader
apt-get install xpdf-utils
apt-get install gocr
apt-get install zip
apt-get install unzip
apt-get install gs
apt-get install enscript
apt-get install antiword
apt-get install libtiff-tools
apt-get install openoffice.org
apt-get install python-uno

At the end we have to edit the file /var/www/docmgr/config/app-config.php like in the next line.

define("APP_PYTHON","/usr/bin/python");

We have finished !

Final notes
The new versions of DocMgr permit to edit the OO write file directly inline via web.

But I do not like that, and it does not work well especially when the files are password-protected. I prefer that when I click on a OO 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

You have to find this xml code.

<object>
<extension>odt</extension>
<proper_name>Open Document Text</proper_name>
<mime_type>application/vnd.oasis.opendocument.text</mime_type>
<custom_type>odt</custom_type>
<openoffice>odt</openoffice>
<openoffice_index>1</openoffice_index>
<openoffice_thumb>1</openoffice_thumb>
<openoffice_convert>1</openoffice_convert>
<allow_dmsave>1</allow_dmsave>
<open_with>dmeditor</open_with>
</object>

To disable the editor in line you have to comment the xml element open_with.

<object>
<extension>odt</extension>
<proper_name>Open Document Text</proper_name>
<mime_type>application/vnd.oasis.opendocument.text</mime_type>
<custom_type>odt</custom_type>
<openoffice>odt</openoffice>
<openoffice_index>1</openoffice_index>
<openoffice_thumb>1</openoffice_thumb>
<openoffice_convert>1</openoffice_convert>
<allow_dmsave>1</allow_dmsave>
<!-- <open_with>dmeditor</open_with> -->
</object>

I have done the same with all the others extension: I only left unchanged txt extension.

Last but not least… I’ve modified /etc/php5/apache2/php.ini to permit a file upload up to 20 MB.

memory_limit = 540M
......
upload_max_filesize = 20M
.......
post_ max_size = 20M

Linkografia

http://www.docmgr.org