I want to recommend VPS hosting from professionals with the best technical support, on which this website works. They have VPS and dedicated servers for any needs. Sign up and get a 25% discount on the first payment for any SSD VPS when paying for one, three or six months.
Installing a 1C server on Linux with a PostgreSQL DBMS server is advantageous for several reasons. The business owner can get significant savings through the use of freely distributed software. For the 1C server, you can use almost any cloud, which will save on the purchase of equipment, connect geographically scattered points, use inexpensive devices to connect in terminal access mode, for example, using a standard Windows RDP client. It can be installed on a separate system unit located in a corner, without a connected monitor, at home or in the office.
In this article, I will tell you how to install a 1C server on Ubuntu 20.04 with Postgres Pro Std 13, as well as a web server on Apache2 and publish the created database there.
- Installing the 1C server on Ubuntu 20.04
- 1. Download the required packages
- 2. Getting instructions for installing Postgresql Pro
- 3. Update Ubuntu and install packages
- 4. Adding a PostgreSQL Pro Repository
- 5. Installing and running HASPD
- 6. Installing Postgres Pro Std
- 7. Configuring the Postgres Pro Std DBMS
- 8. Installing the 1C server
- 9. Setting up the 1C server startup
- 10. Installing thick and thin 1C clients
- 11. Features of hosting the HASP settings file for 1C on Linux
- 12. Checking the database connection
- 13. Creating a database on the 1C server
- 14. Settings for connecting to the 1C server and DBMS
- 15. Running the database on the 1C server in different modes
- 16. Publishing the 1C configuration on the web server
- 17. Checking the launch of the 1C database in the web application mode
Installing the 1C server on Ubuntu 20.04
I made the decision to deploy a testbed in Hyper-V on my laptop. A laptop with the following basic parameters was used:
- Processor: AMD Ryzen 5.
- Storage: 256 GB SSD.
- RAM: 6 GB.
- OS: Windows 10 Professional.
Hyper-V Virtual Container:
- 1 virtual processor.
- 3 GB of dynamic RAM.
- A 20 GB virtual hard disk.
- A DVD drive with an ISO image of Ubuntu Desktop 20.04.2 (64-bit).
I chose Ubuntu Desktop 64-bit deliberately. First, Postgres Pro is only 64 bit. Secondly, I need to test not only the installation of the 1C server, but also the installation of the 1C client:Enterprise for Linux to connect from this OS to your production server, and vice versa. I will leave the installation and configuration of Ubuntu 20.04, as well as the installation of the XRDP server, outside the scope of this article.
1. Download the required packages
First of all, I logged in to the site users.v8.1c.ru to download the platform distributions.
In the screenshot, I highlighted the packages I downloaded:
Then I need to download the HASP security key driver for Linux to get 1C licenses over the network and from the USB key. I did not get version 7.90 working, and I followed the path of least resistance by downloading HASPD 7.40 to the test bench (I will describe the process below). In order to correctly perform the task of installing the latest software, I will provide a link to download HASPD 7.90 and recommend installing it.
2. Getting instructions for installing Postgresql Pro
Next, I prepare for the installation of the DBMS. I have already registered on the manufacturer’s website, so I go to my personal account, specify the operating system and distribution. I agree to the license agreement and receive instructions for installing Postgres Pro Std in Ubuntu 20.04. You can use it to install this program.
Please note that to use any version of PostgreSQL Pro, you need to buy a license, but you can get the program for free for testing, studying, and development.
3. Update Ubuntu and install packages
All actions I will perform from the graphical mode of Ubuntu Desktop. However, everything I do applies equally to Ubuntu Server 20 64-bit. In the graphical mode of Ubuntu, there is a terminal utility, in which all manipulations will be performed. For remote connection to Linux in console mode, there are a large number of applications that use SSH. I usually use Putty RUS.
To configure the Postgres Pro Std repository, you will need curl. And I’ll install my favorite mc file manager. Before you start updating Ubuntu packages in an open terminal, I write:
sudo apt -y install mc curl
I try to install the libpq package, included in the PostgreSQL distribution, from the 1C site and I get an error about the library version mismatch libssl.so. 1.0.0, and I have deployed version 1.0.3. This indicates that Ubuntu 20.04 has newer libraries than are used by package distributions.
Therefore, you still need to add repositories for installing all packages that are outdated in Ubuntu 20.04, but are needed for installing HASPD and 1C. So I run the command:
echo ‘deb http://ru.archive.ubuntu.com/ubuntu/ bionic main universe’ >> /etc/apt/sources.list
sudo apt update
I agree with everything that apt asks (you can press Enter).
After completion, restart the system, but before doing so, make sure that the 1C and PostgreSQL Pro distributions are loaded successfully. After that, you can move on. I put the necessary packages for the functioning of 1C:
I forbid the system to update them:
I put the necessary packages to install the HASP driver:
apt install dkms flex bison
4. Adding a PostgreSQL Pro Repository
To add a PostgreSQL Pro repository, run the following commands:
curl -o apt-repo-add.sh https://repo.postgrespro.ru/pgpro-13/keys/apt-repo-add.sh
5. Installing and running HASPD
Installing HASPD in Ubuntu 20.04 is quite problematic, in version 7.90, I did not want to install the aksusbd module, which works with USB devices — HASP keys, so the service did not start. I downloaded modules for Ubuntu 15.04 (64-bit) and for HASPD version 7.40.
The apt package manager is good because if there are other packages in the package dependencies, then in 90 out of 100% of cases it will find and install the most suitable ones. Therefore, I expand and copy both files with the .deb extension of the haspd service to the /usr/src/haspd7_40/directory:
sudo mkdir /usr/src/haspd7_40
sudo cp hasp* /usr/src/haspd7_40
sudo cd /usr/src/haspd7_40
sudo apt -y install ./*.deb
The installation result should be the same as in the screenshot above. To automatically start the service in Ubuntu when loading the OS, I run:
systemctl enable haspd
And I restart the service:
systemctl restart haspd
You can check the status of the service like this:
systemctl status haspd
6. Installing Postgres Pro Std
First, you need to add Russian language support to the system. I put localization for the normal functioning of Postgres Pro Std:
sudo locale-gen en_US.UTF-8
sudo locale-gen ru_RU.UTF-8
sudo update-locale LANG=ru_RU.UTF8
sudo dpkg-reconfigure locales
To install the program itself, run:
sudo apt -y install postgrespro-std-13 postgrespro-std-13-contrib
Stopping the service:
systemctl stop postgrespro-std-13
I delete the automatically created database, as it is not suitable for 1C:
rm -r /var/lib/pgpro/std-13/data/*
From the directory where Postgres Pro Std is installed, I run the initialization of the base for 1C:
/opt/pgpro/std-13/bin/pg-setup initdb --tune=1c
Then follow the standard steps for setting up autorun, starting the service, and checking the status. It should be as shown below:
systemctl enable postgrespro-std-13
systemctl start postgrespro-std-13
systemctl status postgrespro-std-13
7. Configuring the Postgres Pro Std DBMS
We go from the console under the postgres user. In this way, we will get access to psql without specifying a password and will be able to configure access to ourselves:
Launching the DBMS console:
I didn’t bother with creating a user, so I use the postgres superuser. Setting the password secret1c:
alter useR postgres with encrypted password 'secret1c';
The output should be OK. Then exit the console:
And we return to the terminal from the postgres environment:
8. Installing the 1C server
Next, you need to figure out how to install 1C in Ubuntu 20.04. I unpack the 1C distributions and put them in folders in /usr/src/1cv83_18_1334. The folder cli — the client part of 1c, serv — the server part, thincli — the thin client (I will write about it separately).
I put the 1C server first:
sudo apt install ./*.deb
It is better to put each file separately, since there is a clear sequence: common, crs, server, ws.
Because as a result, everything may not be set, although I did it.
9. Setting up the 1C server startup
For some reason, in the last six months, when installing the 1C server, a link for the service is not created. So I create it myself:
ln -s /opt/1cv8/x86_64/188.8.131.524/srv1cv83 /etc/init.d/srv1cv83
After that, you can configure autorun of the service:
systemctl enable srv1cv83
systemctl restart srv1cv83
systemctl status srv1cv83
10. Installing thick and thin 1C clients
First I go to the directory /usr/src/1cv83_18_1334/cli
Then, to install a thick client, I run:
sudo apt install ./1c-enterprice-184.108.40.2064-client*.deb
A for installing a thin client:
sudo apt install ./1c-enterprice-220.127.116.114-thin-client*.deb
Please note that when installing a thin client (thin-client), the 1C server is deleted. I will not put a thin client on the 1C server.
11. Features of hosting the HASP settings file for 1C on Linux
The first is that if you need to get a license from the key on another machine, you need the nethasp.ini file . But if in Windows it is enough to put it in the installation directory 1C, the subdirectory conf, then in Linux it should be placed lower down the tree: in the release directory. To do this, I created a symbolic link to the directory in /opt/1cv8/conf:
sudo ln -s /opt/1cv8/conf/ /opt/1cv8/x86_64/18.104.22.1684/conf/
Now 1C will see my network keys.
12. Checking the database connection
To check the work of a thick client, I try to connect to an external 1C server using 1C:Document flow:
It worked, and quite quickly for a fat client and a virtual machine. There are no problems with Russian language encodings.
13. Creating a database on the 1C server
Creating an empty database for development on the DBMS server. I specify the name of the information base and its location. In this example, a database named test will be used.
14. Settings for connecting to the 1C server and DBMS
When you connect to the server, you must specify either the domain name + name, or write the IP + name of the 1C Ubuntu server in the /etc/hosts file of your machine. Postgres Pro Std is located locally relative to the server, so we specify the address 127.0.0.1. I didn’t set up a secure connection for the same reasons: the DBMS server is located locally. I specify the postgres superuser login and secret1c password, which I set during the initial configuration of the DBMS.
Now you can experiment with an empty test database.
15. Running the database on the 1C server in different modes
I run it in the configurator mode with root superuser rights:
16. Publishing the 1C configuration on the web server
The command to install the Apache 2 web server looks like this:
sudo apt -y install apache2
After the configurator is started from the superuser, you can publish the database on the web server. To do this, open the Administration menu in the configurator mode and selectPublishing to a web server.
I specify the name of the database on the web server, in my case, test. I choose in the lineWeb server value Apache 2.4. I specify the home directory for the 1C web application. In my case, /home/user/testDB/web. I press the buttonPublish, and then agree to restart Apache2.
17. Checking the launch of the 1C database in the web application mode
To check it, you can go to the address from the server itself http://127.0.0.1/test. Or log in from any other network device (tablet, smartphone, computer) by the network address or the name of the 1C server:
Now you know how to install 1C Ubuntu 20.04. When installing pre-downloaded packages of the 1C server, a minimum of effort and attention to detail is required, which allows you to automate the installation with a script on bash.
In modern Ubuntu 64-bit, when installing, you have to downgrade the versions of various packages, including those responsible for encryption and ensuring the protection of the system as a whole. For servers that are somehow connected to the public access, you need to configure a firewall( firewall), use additional packages to protect, for example, from password brute force fail2ban, or use third-party services created to prevent automated or targeted attacks.
In general, the performance of the Ubuntu 20.04 (64-bit) OS allows you to use more “heavy” databases, use a cluster of 1C servers and DBMS, connect a large number of users both in the 1C thin client mode and in the RDP (remote desktop) mode with guaranteed minimal costs for the server hardware and licensing of the necessary software.
In terms of server configuration for 10 users, my favorite system looks like this:
AMD Ryzen 7 PRO processor on the MSI B450M MORTAR MAX motherboard, with four RAM modules, an AMD Radeon R9 Gamer Series 8Gb video card, with two 1000 Gb M. 2 SSD storage (Kingston KC2000 drive). Such a system unit, complete with a housing and a power supply, can cost approximately 85,000 rubles today. Due to the fact that the bandwidth of the drives and RAM are stated to be approximately equal, the exchange between the data storage and RAM will occur at approximately the same speed. Therefore, in this configuration, you do not need to perform fine tuning of the 1C server, DBMS.