Instal.lació de la 2.1.3 a Ubuntu 14.04

De Gwiki
Dreceres ràpides: navegació, cerca


Pàgina de gestió de postgresql

Instal.lació

Partim del punt en el que ja tenim instal.lat apache i php en el nostre server. A continuació fem la instal.lació de postgres

  sudo apt-get install postgresql phppgadmin

Per versions anteriors a 14.04

  ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.con

Per Ubuntu 14.04

  sudo cp /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-enabled/phppgadmin.conf

Per defecte, només es pot accedir des de localhost. Si volem accedir des d'altres ubicacions, al fitxer d'Apache de configuracions de phppgadmin ( mireu les comandes anteriors) hem de comentar la línia que permet l'accés des de localhost i descomentar la línia que obre l'accés a qualsevol ubicació.

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.

For now, log into the postgres user like this ( Ho hem de fer des de l'usuari root)

su - postgres
createuser userdb
createdb docmgrbase

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

Now we have to create a MD5 password for userdb and grant full permission on database docmgrbase.

psql
alter user userdb with encrypted password '<very strong password>';
grant all privileges on database docmgrbase to userdb;
Si haguéssim de restaurar una base de dades des d''un fitxer .sql des de consola, hauriem de :
* copiar el fitxer a la carpeta /var/lib/postgresql
* posar postgres com a propietari del fitxer i executar
* "psql -d dbname -f file.sql"

MD5 authentication requires the client to supply an MD5-encrypted password for authentication. To do that, edit /etc/postgresql/9.3/main/pg_hba.conf file.

Add or Modify the lines as shown below [...]

  1. TYPE DATABASE USER ADDRESS METHOD
  2. "local" is for Unix domain socket connections only

local all all md5

  1. IPv4 local connections:

host all all 127.0.0.1/32 md5

  1. IPv6 local connections:

host all all  ::1/128 md5 [...]

Restart postgresql service to apply the changes:

  sudo service postgresql restart

You can check if all works fine using the next

psql -U userdb docmgrbase
password: <very strong password>

To exit: \q

S'han d'instal.lar llibreries de php

  sudo apt-get install php-cli php-pgsql php-imap 
  sudo service apache2 restart

Accés postgres a phppgadmin

# sudo su - postgres
# psql -d template1
template1=# ALTER USER postgres WITH PASSWORD 'new password';
# service postgresql restart

Promocionar a superuser

Des de template1#

ALTER USER admin_pg WITH SUPERUSER;
ALTER USER admin_pg WITH PASSWORD 'XXXXXX';

Cambiar les configuracions de login

Change the authentication method in the Authentication Configuration File:

sudo nano /etc/postgresql/9.3/main/pg_hba.conf

The change can be made in the following line:

# "local" is for Unix domain socket connections only
local   all             all                                    md5

1). Open -> /etc/phppgadmin -> config.inc.php

2). change $conf['extra_login_security'] = true; to $conf['extra_login_security'] = false;

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.

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

Now point your browser to the DocMGR installation (http:///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

apt-get install zip unzip enscript libtiff-tools wget poppler-utils poppler* ImageMagick*

Install ocrad

Indicacions per centos

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
yum update
yum install lzip gcc*

Download from http://www.gnu.org/software/ocrad/ocrad.html

tar -xvf ocrad-0.25.tar.lz
cd ocrad-0.25
./configure
make
make install