4. Установка генератора печатных форм
- Для работы генератора печатных форм требуются шрифты MS и виртуальный X-сервер.
- Перед установкой проверить:
- pgagent должен быть установлен и запущен
- на сервере должен быть создан каталог
/usr/local/PLATEX/pgascripts
- с FTP-сервера должен быть загружены архивы bill_file_generator.zip и report_file_generator.zip
Пример установки на дистрибутив семейства RHEL (Almalinux)
Шаг 1. Установка зависимостей и шрифтов:
> [root] yum -y install wget curl gtk2.x86_64 cabextract xorg-x11-font-utils fontconfig
> [root] wget ftp://ftp.pbone.net/mirror/vault.centos.org/altarch/7.8.2003/os/i386/Packages/xorg-x11-server-Xvfb-1.20.4-7.el7.i686.rpm
> [root] yum -y install xorg-x11-server-Xvfb-1.20.4-7.el7.i686.rpm
> [root] yum -y install https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
Шаг 2. Конфигурация и запуск виртуального X-сервера:
Создать файл Xvfb.service со следующим содержимым:
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
User=pgagent
Group=pgagent
Environment=DISPLAY=":99"
ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24
[Install]
WantedBy=multi-user.target
Запустить сервис:
> [root] mv Xvfb.service /etc/systemd/system/Xvfb.service
> [root] systemctl enable Xvfb.service
> [root] systemctl start Xvfb.service
Шаг 3. Установка bill_file_generator и report_file_generator:
> [root] unzip -x bill_file_generator.zip
> [root] rm -r bill_file_generator.zip
> [root] mv bill_file* /usr/local/PLATEX/pgascripts/
> [root] unzip -x report_file_generator.zip
> [root] rm -r report_file_generator.zip
> [root] mv report_file* /usr/local/PLATEX/pgascripts/
> [root] chown -R pgagent:pgagent /usr/local/PLATEX/pgascripts/
> [root] chmod +x /usr/local/PLATEX/pgascripts/bill_file_generator
> [root] chmod +x /usr/local/PLATEX/pgascripts/bill_file_generator.sh
> [root] chmod +x /usr/local/PLATEX/pgascripts/report_file_generator
> [root] chmod +x /usr/local/PLATEX/pgascripts/report_file_generator.sh
Пример установки на дистрибутив семейства Debian (Ubuntu)
Шаг 1. Установка зависимостей и шрифтов:
> [root] apt install wget curl cabextract fontconfig xvfb ttf-mscorefonts-installer xfonts-utils
> [root] wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8.1_all.deb
> [root] dpkg -i ttf-mscorefonts-installer_3.8.1_all.deb
> [root] mkdir fonts
> [root] cd fonts
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/times32.exe# wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/impact32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/georgi32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/courie32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/arialb32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/andale32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/wd97vwr32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/webdin32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/verdan32.exe
> [root] wget --no-check-certificate https://sourceforge.net/projects/corefonts/files/the%20fonts/final/trebuc32.exe
> [root] cd ..
> [root] dpkg-reconfigure ttf-mscorefonts-installer fonts
> [root] ln -s /usr/share/fonts/truetype/msttcorefonts /usr/share/fonts/msttcore
Шаг 2. Конфигурация и запуск виртуального X-сервера:
Создать файл Xvfb.service со следующим содержимым:
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
User=pgagent
Group=pgagent
Environment=DISPLAY=":99"
ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24
[Install]
WantedBy=multi-user.target
Запустить сервис:
> [root] mv Xvfb.service /etc/systemd/system/Xvfb.service
> [root] systemctl enable Xvfb.service
> [root] systemctl start Xvfb.service
Шаг 3. Установка bill_file_generator и report_file_generator:
> [root] unzip -x bill_file_generator.zip
> [root] rm -r bill_file_generator.zip
> [root] mv bill_file* /usr/local/PLATEX/pgascripts/
> [root] unzip -x report_file_generator.zip
> [root] rm -r report_file_generator.zip
> [root] mv report_file* /usr/local/PLATEX/pgascripts/
> [root] chown -R pgagent:pgagent /usr/local/PLATEX/pgascripts/
> [root] chmod +x /usr/local/PLATEX/pgascripts/bill_file_generator
> [root] chmod +x /usr/local/PLATEX/pgascripts/bill_file_generator.sh
> [root] chmod +x /usr/local/PLATEX/pgascripts/report_file_generator
> [root] chmod +x /usr/local/PLATEX/pgascripts/report_file_generator.sh