mMedica – PostgresSQL 9.5 + Debian 8 (Jessie)

Instalujemy Debiana Jessie 8 z netinst.iso .

Ustawiamy locale na pl_PL.CP1250

locale -a
vi /etc/locale.gen    #(dodajemy wpis   pl_PL.CP1250 CP1250 )
dpkg-reconfigure locales
locale-gen pl_PL
locale-gen pl_PL.CP1250
vi /etc/default/locale  #(dodajemy/zostawiamy tylko wpis  LANG=pl_PL.CP1250 )
dpkg-reconfigure locales
shutdown -r 0 # restart serwera

Instalujemy postgresa wersja 9.5 (9.5.15) ze źródeł

apt install vim-scripts make build-essential
mkdir 9.5; cd 9.5
wget -c https://ftp.postgresql.org/pub/source/v9.5.15 /postgresql-9.5.15.tar.bz2 --no-check-certificate
bunzip2 postgresql-9.5.15.tar.bz2
tar xf postgresql-9.5.15.tar
cd postgresql-9.5.15
apt install libreadline-dev libzzip-dev zlib1g-dev
./configure
make
make world
#make check (uruchamiamy jako user)
make install
make install-docs
make install-world

adduser postgres
mkdir /usr/local/pgsql/data
mkdir /usr/local/pgsql/log
chown postgres:postgres /usr/local/pgsql/data
chown postgres:postgres /usr/local/pgsql/log

apt install zip unzip

mkdir /tmp/medica; cd /tmp/medica
wget -c http://mmedica-download.asseco.pl/inst/inne/PostgreSQL-9.5-Linux.zip
unzip PostgreSQL-9.5-Linux.zip

cp initdb /usr/local/pgsql/bin/initdb
cp libpqwalreceiver.so /usr/local/pgsql/lib/libpqwalreceiver.so
cp pg_ctl /usr/local/pgsql/bin/pg_ctl
cp pg_dump /usr/local/pgsql/bin/pg_dump
cp pg_restore /usr/local/pgsql/bin/pg_restore
cp postgres /usr/local/pgsql/bin/postgres
cp postgres.bki /usr/local/pgsql/share/postgres.bki
cp libpq.so.5.8 /usr/local/pgsql/lib/libpq.so.5.8

su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/
#/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data/ -l /usr/local/pgsql/log/postgresql.log

# z poziomu roota
vi /usr/local/pgsql/data/pg_hba.conf
#edytujemy host    all             all             192.168.0.0/24            md5
vi /usr/local/pgsql/data/postgresql.conf
#edytujemy search_path = 'public,restricted'
#edytujemy listen_addresses = 'localhost,192.168.0.1' wpisując IP serwera

#apt install postgresql-client-9.4


su - postgres
#/usr/local/pgsql/bin/pg_ctl restart -D /usr/local/pgsql/data/ -l /usr/local/pgsql/log/postgresql.log
/usr/local/pgsql/bin/psql -h 127.0.0.1

#tworzymy plik startowy
vi /lib/systemd/system/postgresql.service
--------------------------------------------------
[Unit]
Description=Postgresql-9.5 Service
After=syslog.target systemd-user-sessions.service

[Service]
User=postgres
Group=postgres
Type=forking
TimeoutSec=120
ExecStart=/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/postgresql.log start
ExecStop=/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/postgresql.log stop
ExecReload=/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/postgresql.log reload
ExecStatus=/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/postgresql.log status

[Install]
WantedBy=multi-user.target
-------------------------------------------------
systemctl enable postgresql.service
systemctl start postgresql.service

apt install ntpdate
crontab -e
------------------------------------------------
0 6,18 * * * /usr/sbin/ntpdate 54.37.233.160
------------------------------------------------

#Klient
/usr/local/pgsql/bin/psql

Instalujemy wersję demo mMedica z https://mmedica.asseco.pl/uslugi-i-wsparcie/wersja-demonstracyjna/ (wersja na dzień 16-10-2018 to : ver 5.15.5.0 ) .

Dane do DEMO mMedica (baza MMEDDEMO)
UZYTKOWNIK1/Uzytkownik1
ADMIN1/Admin1admin

wpisy w pliku DBXCONNECTIONS:

[MMEDICA]
DriverName=PostgreSQL
Database=172.16.0.216:5432/MMEDICA
[MMEDDEMO]
DriverName=PostgreSQL
Database=172.16.0.216:5432/MMEDDEMO

Info o zmianach w poszczególnych wersjach https://mmedica-licencje.asseco.pl/MMVersions/MMChangesList.aspx