1C-Bitrix website
1C-Bitrix: Site Management is a web project management system from 1C-Bitrix. It lets you easily manage the structure and content of your website without knowing programming or design. 1C-Bitrix: Site Management does the technical work for you.
In this tutorial, you'll deploy and configure a website using the 1C-Bitrix information portal template. During the configuration, you'll create a VM in Yandex.Cloud, deploy the 1C-Bitrix image on it, and launch the necessary services. As a database, you'll deploy a managed MySQL database cluster and ensure its fault tolerance.
Resources used for proper operation of 1C-Bitrix:
- A VM running Ubuntu 18.04 LTS with access to an external network and hosting 1C-Bitrix.
- A MySQL cluster that serves as a database for the 1C-Bitrix website.
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
Before deploying the server, you need to sign up for Yandex.Cloud and create a billing account:
- Go to the management console. Then log in to Yandex.Cloud or sign up if don't already have an account.
- On the billing page, make sure you linked a billing account, and it has the
ACTIVE
orTRIAL_ACTIVE
status. If you don't have a billing account, create one.
If you have an active billing account, you can create or select a folder to run your VM in. Go to the Yandex.Cloud home page and select or create a folder where you want to create a VM for your server. Learn more about the resource hierarchy in Yandex.Cloud.
Required paid resources
The cost for maintaining the 1C-Bitrix server includes:
- A fee for Yandex Compute Cloud disks and a continuously running VM (see pricing for Yandex Compute Cloud).
- A fee for using a dynamic or static external IP address (see Yandex Virtual Private Cloud pricing).
- A fee for using a managed database (see pricing for Managed Service for MySQL).
The current scenario uses the trial version of 1C-Bitrix with a trial period of 30 days. You can check the cost the product software versions on the 1C-Bitrix official website.
Create a VM in the cloud
To create a VM:
- On the Folder dashboard folder page, in the management console, click Create resource and select Virtual machine.
- In the Name field, enter a name for the VM, such as
bitrixwebsite
. - Leave the default availability zone.
- Under Images from Cloud Marketplace, select the ** Ubuntu 18.04 LTS** image.
- Under Disks, select an SSD with 20 GB.
- Under Computing resources:
- Choose a platform for the VM.
- For 1C-Bitrix to run properly, specify the following configuration:
- Platform: Intel Cascade 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 on the VM creation page.
- In the Public address field, leave the Auto value to assign 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 your preferred username to be created on the VM, for example,
ubuntu
. - In the SSH key field, paste your public SSH key. You need to create a key pair for an SSH connection yourself.
- In the Login field, enter your preferred username to be created on the VM, for example,
- Click Create VM.
You may need to save disk snapshots of your VM. They contain a copy of the VM file system from when the snapshot was created.
You can use disk snapshots for various purposes, such as:
- Transferring data from one disk to another, for example, to a disk in a different availability zone.
- Creating a disk backup before performing operations that may cause damage to your data.
- Performing disk versioning by regularly creating snapshots of the disk.
Create a MySQL database cluster
To create a MySQL database cluster:
-
On the folder page in the management console, click Create resource and select MySQL cluster.
-
Under Host class, select
s2.micro
. These characteristics are enough for 1C-Bitrix to run. -
Under Storage size, select the type of storage: either a more flexible network type (
network-hdd
ornetwork-ssd
) or faster local SSD storage (local-ssd
). At this stage, leave the 10 GBnetwork-ssd
type. This size is enough for the current example. -
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 MySQL database.
- DB name. Leave the default value,
-
Under Hosts, change the Availability zone for the database. To do this, click in the line with host details. In the window that opens, select the desired availability zone and click Save.
We recommend selecting the same availability zone as when you created the VM. This reduces latency between the VM and database.
-
To make your database fault-tolerant, you can add more hosts for it. To do this, select Add host and specify the availability zone to place it in.
-
Leave the other fields as they are.
-
Click Create cluster.
Creating the DB cluster may take several minutes. To check that the new cluster is available, select Managed Service for MySQL in the Yandex.Cloud management console. On the Clusters tab, the cluster status should be Running and its state should be Alive.
Configure a server to work with 1C-Bitrix
To configure the server to work with 1C-Bitrix:
-
Log in to the created server using SSH.
$ ssh ubuntu@<VM-public-IP>
ubuntu
: The username in the Login field that you set when creating the VMTo find out the public IP address of your VM, on the folder page in the management console:
- Choose the Compute Cloud section.
- Click on the name of your VM (in this example, it's bitrixwebsite).
- A window opens with general information about your VM. You can find the public IP address in the Public IPv4 field under Network.
-
Get administrator rights.
ubuntu@bitrixwebsite:~$ sudo -i root@bitrixwebsite:~#
-
Install the necessary software.
root@bitrixwebsite:~# apt-get update root@bitrixwebsite:~# apt-get install -y apache2 libapache2-mod-php php-gd php-mbstring php-mysql
-
Go to the project's working directory.
root@bitrixwebsite:~# cd /var/www/html/
-
Download the 1C-Bitrix: Site Management distribution.
root@bitrixwebsite:/var/www/html# wget https://www.1c-bitrix.ru/download/standard_encode.tar.gz
-
Unpack the downloaded archive and delete unnecessary files.
root@bitrixwebsite:/var/www/html# tar -zxf standard_encode.tar.gz root@bitrixwebsite:/var/www/html# rm -f index.html standard_encode.tar.gz
-
Assign the
www-data
user as the owner of the project's working directory.root@bitrixwebsite:/var/www/html# chown -R www-data:www-data /var/www/html root@bitrixwebsite:/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
-
Configure the PHP settings.
In accordance with the information system requirements, you need to edit the following variables in the configuration file
/etc/php/7.2/apache2/php.ini
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 To edit the file, use the built-in
nano
editor:root@bitrixwebsite:/var/www/html# nano /etc/php/7.2/apache2/php.ini
To find the parameter you need in the
nano
editor, pressCtrl+W
. Look for the required parameter in the table above and save the changes usingCtrl+O
. To exit the editor, pressCtrl+X
. -
Configure the Apache server. In accordance with the information system requirements, you need to edit the
/etc/apache2/sites-enabled/000-default.conf
file.-
Open the file in the text editor:
root@bitrixwebsite:/var/www/html# nano /etc/apache2/sites-enabled/000-default.conf
-
Add the following block after the
DocumentRoot /var/www/html
line:<Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Require all granted
-
Restart the web server to apply all the new settings.
root@bitrixwebsite:/var/www/html# service apache2 restart
-
After you run these commands, the server side is configured for proper operation of 1C-Bitrix.
Configure 1C-Bitrix
Install and configure 1C-Bitrix:
-
Open the 1C-Bitrix: Site Management web interface at:
http://<VM-public-IP-address>/
. A page should open asking you to install 1C-Bitrix. -
Click Next.
-
Read the license agreement and select I accept the license agreement. Then click Next.
-
Since registration is optional, uncheck the corresponding checkbox. Leave Install in UTF-8 encoding and click Next.
-
1C-Bitrix checks if the server is configured correctly. View all the parameters on this page and click Next.
-
Specify the parameters of the created database:
-
In the Server field, enter the fully qualified domain name of the created database. To find it:
- Open the management console folder page in a new browser tab.
- Choose Managed Service for MySQL.
- In the table, select the database you created.
- Select the Hosts tab in the left menu.
- Hover over the Hostname (like
rc1c-cfazv1dbzv02u4qk
) and copy the database fully qualified domain name by clicking the icon that appears. As a result, the fully qualified domain name is added to the hostname and the Server field should contain a name likerc1c-cfazv1dbzv02u4qk.mdb.yandexcloud.net
.
-
In the Username and Password fields, enter the data that you specified when creating the database in Create a MySQL database cluster.
-
In the Database name field, specify the name of the created database (
db1
). -
Leave the default values in the other fields.
-
Click Next.
-
-
Wait for the MySQL database to initialize.
-
Create an administrator account to make changes to your system under. Fill in all the fields and click Next.
-
Select the Information portal template and click Next.
-
Confirm the selection of the only layout template and click Next.
-
Select a color and click Next.
-
Fill in all the fields according to your website requirements and click Install. This starts installing and configuring all system components. Wait for it to complete.
-
After a while, a page appears saying that the system is installed and configured. To start working with the website, click Go to site.
-
You're in content editing mode in the web interface of the system that is completely ready-to-use.
-
To see the website homepage from a user's point of view, click Exit in the upper-right corner of the page to exit from your website admin panel and go to
http://<VM-public-IP-address>/
. To return to edit mode, log in to the website using the 1C-Bitrix administrator credentials.
How to delete created resources
To stop paying for your deployed server, just delete the created bitrixwebsite
VM and DB cluster named BitrixMySQLdb
.
If you reserved a static public IP address specifically for this VM:
- Open the Virtual Private Cloud in your folder.
- Go to the IP addresses tab.
- Find the address you need, click , and select Delete.