今天我想告诉大家如何在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 = '本地主机'
...
上
...
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 安装的更多信息
接下来我们安装1c服务器。
将从 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”
基=”/TestWeb”
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服务。 因此,我们必须根据上述模板手动编辑配置。
来源: habr.com