今天我想告訴大家如何在linux debian 1上搭建一個9c服務器並發布web服務。
什麼是 Web 服務 1c?
優點 - 工作速度快(即使有相當大的數據量),相對方便。
缺點 - 在為數據庫編寫 Web 服務時,您的 1c 程序員會長時間抱怨您。 這件事在寫作上非常奇特。
我不會告訴你怎麼寫
現在,我們已經有了 debian 9 netinst,讓我們開始吧:
安裝 PostgresPro(請注意,它不是免費的,並且僅作為熟悉可能性的一部分而分發):
# apt-get update -y
# apt-get install -y wget gnupg2 || apt-get install -y gnupg
# wget -O - http://repo.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO | apt-key add -
# echo deb http://repo.postgrespro.ru/pgpro-archive/pgpro-11.4.1/debian stretch main > /etc/apt/sources.list.d/postgrespro-std.list
# apt-get update -y
# apt-get install -y postgrespro-std-11-server
# /opt/pgpro/std-11/bin/pg-setup initdb
# /opt/pgpro/std-11/bin/pg-setup service enable
# service postgrespro-std-11 start
# su - postgres
# /opt/pgpro/std-11/bin/psql -U postgres -c "alter user postgres with password 'ВашПароль';"
讓我們告訴 postgresql 監聽所有地址而不僅僅是 localhost
# nano /var/lib/pgpro/std-11/data/postgresql.conf
取消註釋並更改要監聽的地址:
...
#listen_addresses = '本地主機'
...
上
...
監聽地址 = '*'
...
接下來,讓我們允許網絡中的用戶登錄
# nano /var/lib/pgpro/std-11/data/pg_hba.conf
讓我們改變:
# IPv4 本地連接:
託管所有所有 127.0.0.1/32 md5
上
託管所有所有 192.168.188.0/24 md5
託管所有所有 127.0.0.1/32 md5
您可以閱讀有關 1s 的各種 Postgres 安裝的更多信息
此外,我們將服務器設置為 1。
將從 1c 站點下載的存檔上傳到服務器(在我的例子中為 deb64_8_3_15_1534.tar.gz)
# tar -xzf deb64_8_3_15_1534.tar.gz
# dpkg -i *.deb
還有一些小事情:
# apt install imagemagick unixodbc libgsf-bin
現在讓我們安裝 Apache2
# apt install apache2
通過管理控制台或通過 1c 客戶端,我們創建一個數據庫並填寫我們的配置......
現在我們發布數據庫:
1s 進入文件夾。
# cd /opt/1C/v8.3/x86_64/
./webinst -publish -apache24 -wsdir Test -dir /var/www/test/ -connstr "Srvr=10.7.12.108;Ref=test;" -confPath /etc/apache2/apache2.conf
我們爬進 var/www/test/ 看看那裡出現了什麼。
# cd /var/www/test
# nano default.vrd
«
v8.1c.ru/8.2/虛擬資源系統”
href="http://www.w3.org/2001/XMLSchema">www.w3.org/2001/XMLSchema"
href="http://www.w3.org/2001/XMLSchema-instance">www.w3.org/2001/XMLSchema-instance"
基礎=“/測試”
ib="Srvr=192.168.188.150;Ref=測試;">
<standardOdata enable=«false»
重用會話=“自動使用”
會話最大年齡=“20”
池大小=“10”
池超時=“5”/>
«
這些是啟動 1c Web 客戶端所需的方案...現在您可以從瀏覽器的地址“http://ServerAddress/Test”訪問我們的測試數據庫(大小寫很重要!這是 Linux)或指定客戶端中的“基本位置類型”地址http://ServerAddress/Test”,客戶端將使用已發布的數據庫。
但
但是網絡服務呢? (在我的測試配置中,有兩個:用於與會計進行數據交換的WebBuh以及與同名公司的wms系統集成的toplog)。
好吧,讓我們在 vrd 文件中添加幾行......
v8.1c.ru/8.2/虛擬資源系統”
href="http://www.w3.org/2001/XMLSchema">www.w3.org/2001/XMLSchema"
href="http://www.w3.org/2001/XMLSchema-instance">www.w3.org/2001/XMLSchema-instance"
基=“/測試網”
ib="Srvr=IP_addres;Ref=TestWebServ">
<standardOdata enable=«false»
重用會話=“自動使用”
會話最大年齡=“20”
池大小=“10”
池超時=“5”/>
# Вот тут начинается код который публикует веб-сервисы
<point name="WebBuh" # Имя веб-сервиса в конфигураторе
alias="Web_buh.1cws" # Web_buh.1cws - алиас веб-сервиса в браузере
enable="true" # дальше я думаю строки и так понятны
reuseSessions="autouse"
sessionMaxAge="20"
poolSize="10"
poolTimeout="5"/>
<point name="TopLog" # второй веб сервис
alias="toplog.1cws" # toplog.1cws
enable="true"
reuseSessions="autouse"
sessionMaxAge="20"
poolSize="10"
poolTimeout="5"/>
節省。
現在我們的 Web 服務可在“http://ServerAddress/Test/Web_buh.1cws?”處使用。
為什麼必須手工完成?
由於我們的服務器沒有圖形外殼,因此無法在其上運行配置器,因此無法使用常規方式發布它。 安裝在客戶端上的遠程配置器不會在服務器上發布Web服務。 因此,我們必鬚根據上述模板手動編輯配置。
來源: www.habr.com