1C-Bitrix Online Store: Site Management
1C-Bitrix: Site Management
In this tutorial, you'll deploy and configure an online store built on the 1C-Bitrix platform. During the configuration process, you'll create a virtual machine in Yandex Cloud, deploy 1C-Bitrix on it, and launch the necessary services. You'll use a failover Managed Service for MySQL cluster as a database.
To deploy and configure 1C-Bitrix:
- Before you start
- Create a VM in the cloud
- Create a MySQL DB cluster
- Configure a server to work with 1C-Bitrix
- Configure 1C-Bitrix
Before you start
Sign up for Yandex Cloud and create a billing account:
- Go to the management console
and log in to Yandex Cloud or create an account if you do not have one yet. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account, create one.
If you have an active billing account, you can go to the cloud page
Learn more about clouds and folders.
Required paid resources
The infrastructure support cost for 1C-Bitrix includes:
- A fee for a continuously running VM (see Yandex Compute Cloud pricing).
- A fee for using a dynamic or static external IP address (see Yandex Virtual Private Cloud pricing).
- A fee for using a managed MySQL database (see Managed Service for MySQL pricing).
Create a VM in the cloud
To create a VM:
-
Go to the desired folder in the management console
by clicking the folder name under Your resources. -
Click Create resource and select Virtual machine.
-
In the Name field, enter a name for the VM, such as
bitrix
.- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
Select an availability zone to put your virtual machine in. If you don't know which availability zone you need, leave the default.
-
Under Images from Cloud Marketplace, select an image of the Ubuntu 18.04 lts operating system.
-
Under Disks, select an SSD with 13 GB.
-
Under Computing resources, specify the configuration for proper operation of 1C-Bitrix:
- Platform: Intel Ice Lake.
- Guaranteed vCPU share: 20%.
- vCPU: 2.
- RAM: 4 GB.
-
Under Network settings:
- Select the Network and Subnet to connect the VM to. If you don't have a network or subnet, create them right in this section.
- In the Public address field, leave the Auto value to assign the virtual machine a random external IP address from the Yandex Cloud pool, or select a static address from the list if you reserved one in advance.
-
Under Access, specify the information required to access the VM:
- In the Login field, enter a username to create on the VM, such as
ubuntu
. - In the SSH key field, copy the value of your public SSH key. You need to create the SSH key pair yourself.
- In the Login field, enter a username to create on the VM, such as
-
Click Create VM.
Create a MySQL database cluster
To create a MySQL database cluster:
-
On the folder page in the management console
, click Create resource and select the MySQL cluster option. -
In the Name field, enter a name for the VM, such as
bitrix-mysql
.- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
Under Host class, select the Type of the host: s2.micro.
-
Under Database, enter:
- DB name. Leave the default value,
db1
. - Username to connect to the database. Leave the default value,
user1
. - Password for 1C-Bitrix to access the database.
- DB name. Leave the default value,
-
Under Hosts, change the host's Availability zone. To do this, click
in the host's row and select the desired zone in the resulting window.We recommend selecting the same Availability zone as when you created the VM. This reduces latency between the VM and database.
To make the database fault-tolerant, you can add more hosts to the cluster. To do this, click Add host, select the availability zone and subnet, and click Save.
-
Make sure that no public access is requested for the cluster hosts, otherwise 1C-Bitrix won't be able to connect to the cluster.
-
Leave the other fields as they are.
-
Click Create cluster.
Creating the DB cluster may take several minutes.
Configure the VM to work with 1C-Bitrix
To configure the VM to work with 1C-Bitrix:
-
Log in to the virtual machine over SSH (
ubuntu
is the username you set when creating the VM):ssh ubuntu@<VM-public-IP>
To find out the public IP address of your VM:
- Select the folder the VM is in using the management console
. - Select Compute Cloud.
- Click on the name of your VM (
bitrix
in the example). - In the window with general VM info that opens, you can find the public IP address in the Public IPv4 field under Network.
- Select the folder the VM is in using the management console
-
Switch to admin mode:
ubuntu@bitrix:~$ sudo -i root@bitrix:~#
-
Install the necessary software:
root@bitrix:~# apt-get update root@bitrix:~# apt-get install -y apache2 libapache2-mod-php php-gd php-mbstring php-mysql
-
Go to the project's working directory:
root@bitrix:~# cd /var/www/html/
-
Download the
1C-Bitrix: Site Management
distribution:root@bitrix:/var/www/html# wget https://www.1c-bitrix.ru/download/business_encode.tar.gz
-
Unpack the downloaded archive and delete unnecessary files:
root@bitrix:/var/www/html# tar -zxf business_encode.tar.gz root@bitrix:/var/www/html# rm -f index.html business_encode.tar.gz
-
Assign the
www-data
user as the owner of the working directory of the project:root@bitrix:/var/www/html# chown -R www-data:www-data /var/www/html # Make sure the command worked root@bitrix:/var/www/html# ls -l total 76 drwxrwxr-x 6 www-data www-data 4096 May 15 13:50 bitrix -rwxrwxr-x 1 www-data www-data 1378 May 15 13:50 index.php -rwxrwxr-x 1 www-data www-data 150 Mar 11 2013 install.config -rwxrwxr-x 1 www-data www-data 30741 Apr 10 14:36 license.html -rwxrwxr-x 1 www-data www-data 113 Nov 20 2012 license.php -rwxrwxr-x 1 www-data www-data 14054 Feb 6 2017 readme.html -rwxrwxr-x 1 www-data www-data 112 Mar 27 2013 readme.php drwxrwxr-x 2 www-data www-data 4096 May 15 13:50 upload -rwxrwxr-x 1 www-data www-data 691 Oct 27 2009 web.config ...
-
Open the
/etc/php/7.4/apache2/php.ini
configuration file and specify the required PHP settings.Note
The path to the configuration file may differ depending on the
1C-Bitrix
version. Specify the path to the current PHP version on the virtual machine.Previously Now short_open_tag = Off short_open_tag = On display_errors = Off display_errors = On memory_limit = 128M memory_limit = 256M ;date.timezone = date.timezone = Europe/Moscow ;opcache.revalidate_freq=2 opcache.revalidate_freq = 0 ;mbstring.func_overload = 0 mbstring.func_overload = 2 -
Configure the Apache server using the
/etc/apache2/sites-enabled/000-default.conf
file. To do this, add the following block after theDocumentRoot /var/www/html
line:<Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
-
Restart the Apache server to apply all the new settings:
root@bitrix:/var/www/html# service apache2 restart
The server is configured for 1C-Bitrix to run properly. Now you need to configure the 1C-Bitrix system itself.
Configure 1C-Bitrix
Perform initial installation and setup of 1C-Bitrix:
-
Open the
1C-Bitrix: Site Management
web interface. To do this, openhttp://<VM-public-IP-address>/
. A page opens asking you to install 1C-Bitrix. -
Click Next on the installer welcome screen.
-
Read the license agreement and select I accept the license agreement. Then click Next.
-
You don't need to register the product (you can disable this option). Make sure the Install in UTF-8 encoding option is selected and click Next.
-
1C-Bitrix checks if the server is configured correctly. Click Next at the bottom of the page.
-
Setting up the database.
- In the Server field, enter the fully qualified domain name of the created database. To find it:
- Open the folder page in the management console
in a new browser tab. - Select Managed Service for MySQL.
- In the table, click on the row of the DB cluster you created.
- Go to the Hosts tab.
- Hover over the Hostname field value and click
.
- Open the folder page in the management console
- In the Username and Password fields, specify the data that you entered when creating the database.
- In the Database name field, specify the name of the database (
db1
in the example). - Leave the default values in the other fields.
- Click Next.
- In the Server field, enter the fully qualified domain name of the created database. To find it:
-
Wait for the system installation and database initialization to complete.
-
Create an administrator (a user who will manage the system). Fill in the fields based on your personal data and click Next.
-
Select the Online store template and click Next.
-
Confirm the selection of the only template and click Next.
-
Select a color for the previously selected template and click Next.
-
Fill in the fields according to your requirements for the online store and click Next.
-
If necessary, enable the inventory management function and specify when to reserve items at the warehouse. Click Next.
-
Enter your company information and click Next.
-
Select the types of payers your online store should work with and click Next.
-
Select the payment and delivery methods your online store supports and click Next.
-
Wait for the system installation to complete.
-
When the installation is complete, click Go to site.
-
The online store interface opens in edit mode.
-
Click Exit in the upper-right corner of the page and you'll see the site homepage as a regular user. To return to edit mode, log in to the site using the 1C-Bitrix administrator credentials.
Tip
To make system backups, periodically create disk snapshots on your virtual machine.
How to delete created resources
To stop paying for the deployed server, delete the virtual machine named bitrix
and delete the cluster named bitrix-mysql
.
If you reserved a static public IP address specifically for this VM:
- Select the VPC in your folder.
- Go to the IP addresses tab.
- Find the required address, click
, and select Delete.