Table of Contents

System requirements

Server software requirements

PHP enabled web server

Apache (recommended) – the Bitrix software was developed for Apache 2.0 and higher.

PHP

Bitrix24 Self-hosted requires PHP version [dw]7.1.х[/dw][di]From 30 June 2019.[/di] or higher. It is recommended that you use the latest stable release of PHP to prevent PHP failures and to provide the maximum security at the server side.

The following PHP extensions are required:

  • GD – image handling library. Required for building graphs and charts which is essential for the Statistics, Advertising and Helpdesk modules. The library is also used with CAPTCHA.
  • PHP XML – used by the update system. This library is inluded in the standard installation package of PHP. The Windows version of PHP has a built-in XML support.
  • FreeType – required for the correct functioning of CAPTCHA.
  • Regular Expression support (POSIX and Perl compatible) – the system requires the regular expression support at the core level.
  • Zlib compression – the compression library is required by the Compression module and the update system to decrease the amount of transferred data.
  • PHP accelerator is highly recommended, for example OPcache or XCache, in order to significantly speed up the operation of PHP applications.

    Attention: eAccelerator is not compatible with PHP v5.3+ and is not supported any longer in Bitrix products starting from Kernel module version 15.0.13.

Note. UTF-8 is available for MySQL. To ensure the correct support of UTF encryption, check if the mbstring module is installed in PHP. In this context, the php.ini file in the PHP settings must include:
 mbstring.func_overload=2
 mbstring.internal_encoding=UTF-8

Database server support

MySQL

[dw]MySQL 5.6[/dw][di]From 30 June 2019.[/di] version and higher is recommended.

To support MySQL, the system requires the MySQL support for PHP to be installed.

Attention! From 1 January 2017, Bitrix24 has limited support for products using Oracle Database and MS SQL Server: clients cannot download product updates and use new product versions.

Note: Encoding MySQL utf8mb4 is not supported.

Web server configuration

For proper functioning, Bitrix24 requires the following parameters to be set.

PHP settings

The following PHP parameters are essential.

  1. memory_limit = 64M;

    Maximum amount of PHP memory required by the system core.

    Note: this parameter can be changed:
    • by editing the file php.ini directly;
    • from within a script by calling ini_set("memory_limit", "64M");
      This call is added to /bitrix/php_interface/dbconn.php at the installation time using the user-supplied value;
    • in the file .htaccess using the directive: php_value memory_limit 64M
    • in the file httpd.conf using the directive: php_admin_value memory_limit 64M

    Note: parameters can be altered from within the .htaccess file if the following conditions are met:
    • Apache (or compatible) web server is used;
    • .htaccess files are processed by a web server, which means that the web server configuration file (httpd.conf) contains the directive AllowOverride set to All or any value other than None;
    • PHP is installed as an Apache module (if PHP runs as CGI all the required parameters must be set when compiling PHP)

  2. file_uploads = On;
    The parameter defines whether files can be uploaded to a server or not.

    Additionally, the following variables are also to be set:

    • upload_tmp_dir = <folder name>
    • upload_max_filesize = <required file size limit>

    Important: It is essential that the specified directory exists, and a current user (under which the web server runs) is granted the write permissions for this folder.

  3. Proper PHP session handling is the indispensable condition. You are recommended to check that the folder where the session files are saved exists.

    Note: if the parameter session.save_path is missing from php.ini, the default value of /tmp is used.

    If the server URL's happen to contain the PHPSESSID=... parameter, you hide it as follows:
    • Add the line session.use_trans_sid = 0 to php.ini;
    • In .htaccess, add the following directive: php_flag session.use_trans_sid off
      The demo site has this line included in .htaccess, you can uncomment it if required.

Supported standards. Client software requirements

Bitrix Site Manager and Bitrix24 use and support the following technologies.

HTML/XHTML

The system places no restrictions on templates developed with HTML/XHTML.

JavaScript

The system unconditionally supports the use of JavaScript in the site templates, menus and pages.

AJAX

This technology is widely used in the Control Panel and Components 2.0 to speed up the system response and decrease server-to-client data traffic. The system places no restrictions on using AJAX in the public section.

CSS

The design of each site template can be controlled via separate CSS files. Analogously, separate style sheets can be used with public components as well as module templates (e.g. forum, helpdesk, polls). The Control Panel features the use of visual themes: users can create their own custom visual themes through the cascading style sheets.

Flash

The system has limited support for the Macromedia (now Adobe) Flash technology. Flash plug-ins can be used in the following ways:

  • as a part of the site template design;
  • as advertising banners;
  • as user input controls deliberately designed to interact with the system.

RSS

The system supports RSS versions 0.92 and 2.0. In the core, RSS is used to exchange information between the Information Blocks and Blogs modules.

CSV

The system uses the CSV standard to exchange information between the Information Blocks module and other systems.


Browser support

Bitrix Site Manager and Bitrix24 were developed to support the most popular browsers (Internet Explorer 11.0 and higher). The Control Panel is optimized for the maximum performance with them. The public section appearance is browser-independent.


Known problems

  • The visual editor behaviour may somewhat disagree in different browsers (Internet Explorer and FireFox).
  • Some API functions and class methods may produce HTML code that do not fully conform with the XHTML standard, and potentially may not pass the W3C validation.

Installing Bitrix24 Self-hosted

This chapter describes the preliminary steps for the product installation, steps of the installation wizard, as well as selection and initial set-up of the portal for a faster deployment of your project.

It's recommended to install Bitrix24 Self-hosted on a Bitrix Virtual Appliance. You can learn more in a dedicated Bitrix Virtual Appliance.

Preliminary operations

All versions of Bitrix24 are shipped as .zip and .tar.gz archive files for PHP 7.4

  • Download Bitrix24 installation package to your server or computer.
  • Extract files from the archive to the root folder of your site.

Now, ensure your system corresponds minimum requirements.

  1. If required, install Apache web server and configure it to support PHP. Bitrix24 requires Apache version 2.0 or better and PHP 7.4.0 or better (8.0 recommended).
  2. If required, install database engine (MySQL version 5.6 or higher).
  3. If you reinstall the system, remember to remove all tables.
  4. Ensure that you have at least 100 MB of free disk space for the update system.
Attention: Bitrix24 can only install and operate correctly if your system conforms these minimum requirements.

To start installation, open http://<your_site>/index.php in your browser. Replace here <your_site> with the real address of your site.


Step 1. The license agreement

This section contains general description for the Bitrix24 Self-hosted installation procedure.

Note: Installation Wizard can have various number of installation steps depending for different versions of Bitrix24 products. Specifically, first BitrixVM installation window no longer has a [dw]greetings window[/dw][di]Installation Wizard first window shows details on the start of installation process and displays
product's main information.

[/di]. This step is skipped in the installation description.

Note: Starting the Installation Wizard with the parameter clear_db=Y (for example, http://localhost/?clear_db=Y) deletes all data tables with associated entities in the database before starting the installation.

Attention! Use this option only if you are completely aware about consequences of your actions.

Installation step 1

Please, carefully read all details of the License agreement. When you are in agreement with conditions, set the checkbox I accept the terms of the license agreement.

Click Next button to proceed



Step 2. Product registration

Installation step 2

(Enter commercial registration key)

  • Registering license key
  • Selecting installation type
  • Selecting database
  • Selecting site encoding

Product registration

Enter the Registration license key that you received upon successful purchase of Bitrix24 product.

Note: When installing demo product version you will have the available option [dw]I want to register my copy of the program and get updates[/dw][di][/di]. Fill out the registration fields and get access for product updates during the trial period.

Otherwise, your Bitrix24 will be installed, but updates will not be available. You can always register a trial version and receive a trial key for updates (find more in the section Registering a trial version (DEMO)).

Development only

Starting from version 16.5.7 and higher, Bitrix24 products now have a checkmark option for new or old Bitrix24 product instances allowing to avoid blocking of the update system, and consequently for appearing error [dw]ERROR_WRONG_CODE[/dw][di]Product update system is associated to a specific installation and "remembers" the state of the operating system after a new update. An error ERROR_WRONG_CODE occurs if the current state does not match with the state at the moment of the last update.
Learn more...[/di].

Development only allows to perform testing without closing out public access to site and without installing product locally. This feature helps to solve the issue of collective access to a single product installation. This option is also useful when several developers need to have a custom public product instance for testing purposes.

Selecting database

MySQL database have available UTF-8 encoding. If you choose to install UTF-8 version, mark the Install with UTF-8 encoding. However, selecting UTF encoding requires the mbstring PHP module to be installed. You can verify the availability of this module by examining the contents of php.ini file:

mbstring.func_overload=2
mbstring.internal_encoding=UTF-8

Attention! From 1 January 2017, Bitrix24 has limited support of products using Oracle Database and MS SQL Server: clients cannot download product updates and use new product versions.

Site encoding

Mark the option to use the UTF-8 encoding for your Bitrix24 instance.

Presently, HTML document ending has two options between WIN-1251 and UTF-8.

Using the encoding WIN-1251 is appropriate with old versions of MySQL (before version 4.х), which worked with UTF-8 incorrectly. These drawbacks are not present in modern MySQL databases.

To correctly support the UTF-8 encoding, mbstring module must be installed in PHP. To verify it, php.ini file in PHP settings must contain the following:

mbstring.func_overload=2
mbstring.internal_encoding=UTF-8

It is recommended to use UTF-8 encoding for proper versatility and full applicability of existing characters.

Click Next button to proceed with installation



Step 3. Preliminary verification

Note: When the product is installed using BitrixVM (VMWare/VirtualBox), this step is skipped.

Installation step 3

(preliminary verification)

The system is checked for:

  • compatibility to product minimum technical requirements
  • disk access permissions

When check has failed the upper part of screen will show description with details on what conditions were not satisfied. It's not recommended to continue product installation [dw]until incompatibility issues are removed[/dw][di]Technically you can proceed with installation, but it's strongly advised to satisfy
recommended settings. Otherwise, operational issue can occur.

[/di].

Important specifics

Attention! When installing product in the UTF-8 encoding, the mbstring.func_overload parameter must be equal to 2. This encoding cannot have other values.

When installing product in the UTF-8 encoding at the preliminary check, parameters mbstring.func_overload and mbstring.internal_encoding can be highlighted in red. In this case, specify these strings in the php.ini file:

mbstring.func_overload = 2
mbstring.internal_encoding = UTF-8
Note. Site can be installed with win-1251 encoding, when it's required for the value overload to be qual 2. Use cp1251 for parameter encoding as follows:
mbstring.func_overload = 2
mbstring.internal_encoding = CP1251

    Click Next to continue the installation procedure.


Step 4. Database creation

Note: When the product is installed using BitrixVM (VMWare/VirtualBox), this step is skipped.

Installation step 4

(creating MySQL database)

Config file for connection with database is created and data is uploaded to the database.

Local installation

When installing to local computer with already pre-installed application for correct operation (Apache, PHP, MySQL) fill out the fields as follows:

  • Server: server used for database management system (DBMS), in this case, MySQL. Local computer parameter contains localhost с with port used for MySQL in the format localhost:[port_number]. Port number can be found in MySQL configuration files.
  • Database user: select create new user;
  • User name: enter arbitrary DBMS user (login) for database access.
  • Password: user password for database access.
  • Database: create new database.
  • Database name: created database name. Any name in Latin characters; numerals and underscore are permitted.
  • Database table type: standard type is suitable in majority of cases. Two options are available:
    • Standard. Standard MySQL table type is MyISAM which is not transaction-oriented. For MylSAM table type, all data are saved in a single file, consequently maximum file size is simultaneously is the maximum table size.

      Operation systems have their out limits on maximum file size. Usually, it is from 2 to 4 GB. MylSAM tables are platform-independent. Table files can be moved between computers with various architectures and different operation systems without any conversion.

    • Innodb. InnoDB table in MySQL have table handler enabling safe transactions with possible transaction commitment, rollback and crash recovery.

      InnoDB tables can block at the string level, as well use read method without blocking at SELECT command. Transaction log is maintained in case of transaction rollback. It's susceptible to internal overwrite, i .e when new records are created, old records are deleted from them. These listed features allows improving interoperability and increase performance in multi-user mode.

      InnoDB are intended for getting maximum performance when processing large data volumes. This type hugely exceeds other models of relational database systems in processor performance.

  • Next, select Create new database. Additional group appears: [dw]Database administrator password and login[/dw][di][/di].
    • Enter root in Login field.
    • Leave Password field empty.

Remote server

When specifying database parameters on remote server, request technical support and complete the following fields:

  • Server: indicate server used by database management system (DBMS).
  • Database user: this defines it new database user is created during installation or existing user data is used.
  • User name: DBMS user name (login) for database access.
  • Password: user password for database access.
  • Database: defines if new database is created during installation of existing database is used.
  • Database name: database name used to install the product.
  • Database table type:selection between different database table types.

Attention! Standard table type will be suitable in most in cases. For site with increased load requirements such as online stores, for example, InnoDB type is preferable for MySQL databases.

Attention! When during installation process new user or new database must be created, a database administrator Login and Password are required. In case no database was created previously, you must select new in the Database field. Usually, database is created on server by the hosting server itself. You need only retrieve name and parameters for accessing it.

Additional parameters

These parameters defines access permissions to site files (for all database types).

Complete the fields:

  • Access permissions to site files: access permissions for created files. Access permissions must be sufficient for web server access to write. Default value 0644;
  • Access permissions to site folders: access permissions for created catalogs. Access permissions must be sufficient for web server access to write. Default value 0755.

Note: Manual database connection parameter setup (including maximum memory size for executing the script) can be executed in file /bitrix/php_interface/dbconn.php and /bitrix/.settings.php. Files will be created after installation is complete.

Click Next to continue installation.



Step 5. System installation

Installation step 5

(product installation progress)

It's an automatic process when database tables are created and system files are installed. The progress can be traced using the visual progress bar. When the database creation progress is complete the system automatically proceeds to the next step.



Step 6. Creating an administrator's account

Installation step 6

(creating an administrator's account)

At this stage, site is configured and administrator account is created that will have access to all site management configs. After the system is installed, administrator can create additional account instances for users with lower access permissions level.

Fields, marked with * are required for completion.

  • Login: login (name) of site administrator to be used when entering site's administrative section. Login must not be shorter than three characters. Login must contain only Latin and numerical characters.
  • Password: site administrator password used for entering site's administrative section. Login must contain only Latin and numerical characters.

    Important! It's strongly recommended to use complex site administrator password with length more than 6 characters.

  • Confirm password: password is entered again to verify correct input.
  • E-Mail: site administrator e-mail address.
  • Name: site administrator name.
  • Last name: site administrator last name.

Note: Specified password and login can be used further for authentication when entering the system.

Click Next to continue installation to open Site Configuration Wizard.


Bitrix24 Configuration Wizard

Bitrix24 Configuration Wizard

This chapter provides detailed step-by-step instructions regarding portal and extranet site set up.

Note: the number of steps in the portal and extranet setup wizards may differ depending on installation options.

Bitrix24 Configuration

Step 1. Initial screen

This screen informs you that the configuration wizard has started.

  • Here, just click Next.

Step 2. Design template

Choose the design template for your Bitrix24. Templates vary in layout, colour, appearance of the main page and settings.

  • Select a desired template by ticking a respective radio button.
  • Click Next.
Note. Portal templates are system templates and cannot be customized! There is a technical possibility to copy, customize, and apply the template, but in this case the backward compatibility will be lost.

Step 3. Colour theme

Here you will choose the desired colour theme for your Bitrix24. Different site design templates offer different colour schemes.

  • Choose the desired color theme and click Next.

Step 4. Portal settings

Provide here the name and the logo of your company. Select the features you want to enable on your Bitrix24.

  • Type the name of your company and click Browse to select the logo image of your company.
  • In order to set the demo data of employees, include social network and external communication functionality, and set up access rights on the portal please select the relevant options.
  • Click Install to proceed to the next step.

Step 5. Data installation

This is an unattended step that installs Bitrix24 according to the selected preferences. You can watch the process proceeding in the progress bar. Upon completion the wizard will open the next step automatically.


Step 6. Finishing configuration

The system has been installed and the initial configuration has been applied.

Now you can:

  • Import users to your Bitrix24 (click Import Users).
  • Open your Bitrix24 and start working (click Launch Bitrix24).
  • Run the Extranet Configuration Wizard (click Configure Extranet).

Note: the Configuration Wizard may also be launched again after the product installation. For example, in order to change a template or color set of the portal or include additional modules (depending on the license), etc

Administrator’s interface: select Install option in the actions menu in Corporate Portal Wizard (Settings > System settings > Wizard list):

Extranet Configuration

Wizard step 1 (Setup Start)

The first window informs about the wizard’s start.

  • Click Next.

Wizard step 2 (Extranet Site Design)

Automatic step where template is selected.

Wizard step 3 (Color Set)

Automatic step where the color set is selected.

Wizard step 4 (Site Setup)

Here, the main extranet settings are established: Company Name, Extranet Site ID, and Extranet Site Folder.

  • In order to proceed, please click Install.

Wizard step 5 (Data Setting)

Automatic step where all the extranet settings are determined. Graphic indicator helps to monitor the progress. When the installation is completed, the system will automatically move on to the next step.

Wizard step 6 (Installation Completion)

The installation and setup are completed.

  • Please click Open Portal to open the extranet home page.

Note: the Extranet Wizard may also be launched again after the product installation. For example, in order to change the extranet template or other settings. The wizard may be launched by either of the following two manners:
  1. Public interface: using the Wizard button on the Control Panel:

  2. Administrator’s interface: select Install option in the actions menu in the Corporate Portal Extranet Setup Wizard (Settings > System settings > Wizard list):

Site installation in BitrixVA/BitrixEnv

Installing Bitrix24 On-Premise

To install Bitrix24 product, it is necessary:

  1. To go to the bitrix url address, indicated in BitrixVM or BitrixEnv in browser. Welcome page with installation options will open:

  2. Choose one of the options to continue with installation:

    • Install - launches the installation wizard that allows downloading and installing a new site via Bitrix24 product tools. Steps in this option are similar to the steps, reviewed in the Product installation via BitrixSetup chapter (Installation using BitrixSetup).

    • Restore Copy - launches the installation wizard that allows migrating an existing project (restored from backup copy). Steps of this options are similar to the steps, reviewed in the Product transfer chapter.

Installing using BitrixSetup

Downloading BitrixSetup script

Bitrix24 can be easily installed at a remote server by uploading the installation files via the FTP or using the BitrixSetup script. In the first case, download the commercial or trial version and unpack it at a local machine. Then, use any FTP client to upload the extracted files to the root folder of your web server. Otherwise, upload the archive to the server and extract files remotely.

However, we strongly recommend that you use the special BitrixSetup script to avoid upload errors and eliminate a frequently occurring problem of different FTP and Apache user access permissions.

BitrixSetup uploads the trial or commercial version of Bitrix Site Manager to your site directly from www.bitrixsoft.com without the intermediate downloading step. Furthermore, the script can extract files from the installation package if you cannot access your site via SSH or third-party software.

Setup procedure

  • Download the script at http://www.bitrixsoft.com/download/scripts/bitrixsetup.php.
  • Click the Download button.
  • Establish an FTP connection to your server.
  • Upload the downloaded file to the root directory of your web server.
  • In your browser, type http://<your_site>/bitrixsetup.php (replace <your_site> with the real site name) and press Enter. The browser will display a BitrixSetup welcome page.

Warning: Please ensure that your web server has enough permissions to create and write files.
  • Select the appropriate version in the License key field.
    • Demo version can be installed without a license key, or with a trial key.
    • Commercial version requires that you enter the license key previously obtained from Bitrix.
  • In the Choose a package field, select the product edition whose trial version you wish to install.
  • Click Download. This will open the Downloading installation package page.

BitrixSetup will connect to the Bitrix server directly. The script will copy the installation files to the root directory of your site and unpack them if you have chosen to do so.

The Back button allows you to return to the previous section where you can alter the installation settings (e.g. product edition).

The status bar displays diagnostic messages about the current operation (e.g. downloading or extracting files). The progress bar reflects the operation flow.

After the process of loading and extraction is complete, the browser will display the Installation Wizard (e. g., for Bitrix24 Self-hosted)

Important! For security reasons, bitrixsetup.php is deleted from the root directory of your site after installation procedure is complete.

Uninstalling Bitrix24

Uninstalling Bitrix24 Self-hosted

You can uninstall the Bitrix24 by selecting one of the commands:

  • Menu Start > Settings > Control panel > Add Remove Programs
or
  • Menu Start > Programs > Bitrix Web Environment > Uninstall.

Removing Bitrix24 from a remote server deletes the database files as well as all files and folders from the root folder of your web server.

Check that …/www folder was removed from the Bitrix Environment folder as well.

Installing Bitrix24 Self-hosted on other environments

This section details settings, required for installing Bitrix24 Self-hosted to third-party environments.

Attention! Operations, described in this section, require knowledge of server administration. Because the installation on other environments is tested by the vendor, but is not a main platform for Bitrix Framework product use, undocumented issues can be encountered during installation. Please, be aware of actions taken by you within the system during product installation.

Installing environment for SLES 15

This section details environment settings for operations system SUSE Linux Enterprise Server 15 used to install Bitrix24 Self-hosted products, including installation and setup of operation system itself, required packages and service configuration.

OS installation and setup

Start from installing SUSE Linux Enterprise Server 15 (SLES 15) distribution package. Review selection of additional modules and extensions available for installation and select the server with minimum setting.

Attention: Further settings are based on this installation specifically.

Also, activate the subscription. It can be done during installation: configure it after installation is complete via the command:

SUSEConnect -e EMAIL_ADDRESS -r REGISTER_CODE

Subscription is issued to an account. That's why, during activation, indicate email_address and password used for registration at the official SUSE website.

For the main package manager, SUSE uses [dw]zypper[/dw][di]Zypper - console package manager, based on libzypp library, used in the GNU/Linux openSUSE distribution package.[/di].

  1. Update the system to the latest stable version.
  2. zypper refresh
    zypper update
    
  3. Connect additional extensions (official repositories) to install additional packages:
  4. # python modules
    SUSEConnect --product sle-module-python2/15.2/x86_64
    # for php and nodejs (push-server)
    SUSEConnect  --product sle-module-web-scripting/15.2/x86_64
    

View all available repositories using the command:

SUSEConnect --list-extensions

Be default, SELinux is not installed for minimum installation, that's why no additional settings are required to disconnect it.

Package installation

Below is the complete list of packages needed for Bitrix24 Self-hosted.

Installation step-by-step

  1. Install apache version 2.4 and php 7.2:
  2. zypper -n install apache2
    
    zypper -n install php7 php7 php7 \
        php7 php7-opcache php7-zip php7-posix \
        php7-zlib php7-openssl php7-mbstring \
        php7-bz2 php7-curl php7-iconv \
        php7-json php7-pecl php7-devel php7-sockets  \
        php7-gd apache2-mod_php7 php7-mysql
    
  3. Install Nginx (version 1.16):
  4. zypper -n install nginx
    
  5. Install MariaDB server (version 10.4):
  6. zypper -n install mariadb
    
  7. Install Node (version 14) and npm (push-server):
  8. zypper -n install nodejs10
    
  9. Install Redis:
  10. zypper -n install redis
    


Nginx configuration

Execute Nginx configuration.

  • Work site directory - /var/www/html/bx-site.
  • Web environment user - wwwrun.

Server nginx configuration:

/etc/nginx/nginx.conf                                       # main config file
            |_conf.d/upstreams.conf                         # configuration for upstream servers: apache && push-server
            |_conf.d/maps-composite_settings.conf           # variable used for cache
            |_conf.d/maps.conf                              # additional variables
            |_conf.d/http-add_header.conf                   # CORS headers
            |_sites-available/*.conf                        # connect sites
                              |_default.conf                # default site (configure port 80 only)
                                    |_conf.d/bx_temp.conf   # BX_TEMPORARY_FILES_DIRECTORY configuration
                                    |_conf.d/bitrix.conf    # default site configuration
                              |_rtc.conf                    # query proxying at push-server (publication)

Default site configuration:

conf.d/bitrix.conf                                          # main blocks with cache enabled by default in files
        |_conf.d/bitrix_general.conf                        # sending statistics, quick transfer for external storages and etc.
                |_conf.d/errors.conf                        # error processing
                |_conf.d/im_subscrider.conf                 # query proxying to push-server (receiving)
                |_conf.d/bitrix_block.conf                  # blocking by default

Configuration is sourced from virtual appliance and can be deemed excessive, but in effect supports the same options as the virtual appliance.

All configuration files can be downloaded in archive. Config files for Nginx are located in the folder as follows: sles15/nginx.

Place them in the directory /etc/nginx/.

The service uses names for proxying to specific services:

  • httpd - query proxying to apache;
  • push - query proxying to push-server.

For configuration to be operational, write the services in local addresses. When services are located on another host, indicate the correct address here:

echo "127.0.0.1 push httpd" >> /etc/hosts

Start the service:

systemctl --now enable nginx

Add rules for firewalld:

firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload


PHP configuration

This installation version has centralized configuration storage: -- /etc/php7/conf.d

It requires such settings as a minimum:

  • for the module OPCache (opcache.ini):
  • opcache.max_accelerated_files = 100000
    opcache.revalidate_freq = 0
    
  • add settings into file zx-bitrix.ini:
  • display_errors = Off
    error_reporting = E_ALL
    error_log = '/var/log/php/error.log'
    
    ; Set some more PHP parameters
    enable_dl = Off
    short_open_tag = On
    allow_url_fopen = On
    
    # Security headers
    mail.add_x_header = Off
    expose_php = Off
    ...
    

All configuration files can be downloaded in archive . Config files for PHP are located in the folder as follows: sles15/php.d.

Place them in the directory /etc/php7/conf.d/.

Set user as the owner and the group root:

chown root:root /etc/php7/conf.d/ -R

Apache configuration

By default, Apache is configured for default site in the catalog /var/www/html.

The main setup is required for Apache config is as follows:

  • update catalog for the site at var/www/html/bx-site;
  • update port that service listens (because nginx is used as an external service);
  • import site settings from virtual appliance.

All configuration files can be downloaded in archive . Config files for Apache are located in the folder: sles15/httpd.

Place them in the directory /etc/apache2/.

Two files must be configured:

  • vhosts.d/default.conf - replace directory in site description to var/www/html/bx-site;
  • httpd/listen.conf - indicate port 8090 for Listen.

After that, start the service

systemctl --now enable apache2

MariaDB configuration

MariaDB configuration requires executing the following settings:

  • transaction-isolation update to READ-COMMITTED;
  • innodb_flush_method set as O_DIRECT (preferred, but optional setting);
  • innodb_flush_log_at_trx_commit set as 2 (preferred, but optional setting).

All configuration files can be downloaded in archive . Config files for MariaDB are located in the folder: sles15/my.cnf.d.

Place them in the directory /etc/my.cnf.d/.

Start the service:

systemctl --now enable mariadb

Service setup is executed via mysql_secure_installation.

Push-server configuration

The setup:

 -----------------------                                   ---------------------------------------------------
| nginx: 0.0.0.0:80     | -> /bitrix/sub|/bitrix/subws -> | node server.js --config push-server-sub-80XX.json |
 -----------------------                                   ---------------------------------------------------

 -----------------------                     ---------------------------------------------------
| nginx: 127.0.0.1:8895 | -> /bitrix/pub -> | node server.js --config push-server-pub-90XX.json |
 -----------------------                     ---------------------------------------------------

Nginx proxies query to push service of selected type. Message getting queries (for example, sub) are public and proxied from standard ports 80/443. Publication queries (pub) are available only from internal server address.

Nodejs processes are split into two types:

  1. Processes responsible for connecting user to selected channel and message reception. Listen to ports: 8010-8015;
  2. Processes responsible for sending message to channel. Listen to ports: 9010-9011.

To start Push-server we need:

  • nodejs & npm ;
  • service and its modules archive.

For installation we require Python or a make utility:

zypper install python3 make wget -y

Execute the following actions:

  1. Download archive from repository repos.1c-bitrix.ru
    wget https://repos.1c-bitrix.ru/vm/push-server-0.2.2.tgz
    or the push-server-0.2.2.tgz archive from site and place it into directory /opt. Execute the installation:
    su -
    cd /opt
    npm install --production ./push-server-0.2.2.tgz
    

    Installation will finish with string:

    + push-server@0.2.2
    added 65 packages from 78 contributors and audited 65 packages in 45.77s
    
  2. Execute (exclusively for convenience):
    su -
    ln -sf /opt/node_modules/push-server/logs /var/log/push-server
    ln -sf /opt/node_modules/push-server/etc/push-server /etc/push-server
    
  3. Copy service files and the main configuration:

    su - 
    cd /opt/node_modules/push-server
    cp etc/init.d/push-server-multi /usr/local/bin/push-server-multi
    cp etc/sysconfig/push-server-multi  /etc/sysconfig/push-server-multi
    cp etc/push-server/push-server.service  /etc/systemd/system/
    ln -sf /opt/node_modules/push-server /opt/push-server
    
  4. Create temporary directory:
    echo 'd /tmp/push-server 0770 wwwrun www -' > /etc/tmpfiles.d/push-server.conf
    systemd-tmpfiles --remove --create
    

    Edit config file /etc/sysconfig/push-server-multi. The following parameters must be corrected/added:

    • USER/GROUP - user that launched service;
    • SECURITY_KEY - secret key for connection signature between customers and push server;

      Note: Key length doesn't matter. The key can use only Latin letter and numbers, special characters are prohibited. But, be advised, that a too short of a key is unsafe. It can be generated as follows:
      cat /dev/urandom |tr -dc A-Za-z0-9 | head -c 128

    • RUN_DIR - director for process PID file storage.

    Example of parameter settings:

    GROUP=www
    USER=wwwrun
    SECURITY_KEY="SECURITYKEY123456"
    RUN_DIR=/tmp/push-server
    REDIS_SOCK=/var/run/redis/default.sock
    
  5. Each nodejs process is launched as separate process. Generate the configs:
    /usr/local/bin/push-server-multi configs pub
    /usr/local/bin/push-server-multi configs sub
    

    Generated configs in the format [dw]json[/dw][di]push-server-sub-80XX.json
    push-server-pub-90XX.json[/di] will be located in this directory: /etc/push-server/.

  6. Update the user and path to script in the service config file /etc/systemd/system/push-server.service:

    [Service]
    User=wwwrun
    Group=www
    ExecStart=/usr/local/bin/push-server-multi systemd_start
    ExecStop=/usr/local/bin/push-server-multi stop
    ...
    
  7. Update access permissions for directory with logs:

    chown wwwrun:www /opt/node_modules/push-server/logs /tmp/push-server -RH
    
  8. Reconfigure:
    systemctl daemon-reload
    
  9. Start the service:
    systemctl --now enable push-server
    
  10. Go to push module config (site settings) and enable local push server (latest version). Additionally, indicate SECURITY_KEY parameter, configured previously above in the file /etc/sysconfig/push-server-multi.


Installing environment for RedHat8

This section details environment settings for operations system RedHat8 used to install Bitrix24 Self-hosted products, including installation and setup of operation system itself, required packages and service configuration.

OS installation and setup

Start from installing Red Hat Enterprise Linux 8 (RedHat8) distribution package. Review selection of additional modules and extensions available for installation and select the server with minimum setting.

Attention: Further setup are based on this installation specifically.

When installation is complete, activate the subscription, otherwise system updates and preferences won't operate correctly:

subscription-manager register --username email_address --password password --auto-attach

Subscription is issued to an account. That's why, during activation, indicate email_address and password used for registration at the official RedHat website.

During authorization, you can use login, specified during registration instead of an email.

Only official repositories from RedHat can be used for installation.

dnf is used as the package manager. Update the system to the latest stable version. Disable selinux

su -
dnf update -y
echo 'SELINUX=disabled' > /etc/sysconfig/selinux
reboot



Package Installation

The list below contains packages required for Bitrix24 Self-hosted.

  1. Install apache 2.4 and php 7.2:
    dnf -y install httpd
    
    dnf -y install php php php-cli php-common \
        php-devel php-gd php-json php-mbstring \
        php-mysqlnd php-opcache php-pdo php-pear \
        php-pecl-apcu php-pecl-zip php-process php-xml php-ldap
    
  2. Install nginx (version 1.14):
    dnf install nginx -y
    
  3. Install MariaDB сервер (version 10.1):
    dnf install mariadb -y
    
  4. Install node и npm (push-server):
    dnf install nodejs -y
    
  5. Install redis:
    dnf install redis -y
    


  6. Nginx configuration

    Execute Nginx configuration.

    • Work site directory - /var/www/html/bx-site.
    • Web environment user - nginx, apache group.

    Server nginx configuration:

    /etc/nginx/nginx.conf                                       # main config file
                |_conf.d/upstreams.conf                         # configuration for upstream servers: apache && push-server
                |_conf.d/maps-composite_settings.conf           # variables used for cache
                |_conf.d/maps.conf                              # additional variables
                |_conf.d/http-add_header.conf                   # CORS headers
                |_sites-available/*.conf                        # connect sites
                                  |_default.conf                # default site (configure port 80 only)
                                        |_conf.d/bx_temp.conf   # BX_TEMPORARY_FILES_DIRECTORY configuration
                                        |_conf.d/bitrix.conf    # default site configuration
                                  |_rtc.conf                    # query proxying at push-server (publication)
    

    Default site configuration:

    conf.d/bitrix.conf                                          # main blocks with cache enabled by default in files
            |_conf.d/bitrix_general.conf                        # sending statistics, quick transfer for external storages and etc.
                    |_conf.d/errors.conf                        # error processing
                    |_conf.d/im_subscrider.conf                 # query proxying to push-server (receiving)
                    |_conf.d/bitrix_block.conf                  # blocking by default
    

    Configuration is sourced from virtual appliance and can be deemed excessive, but in effect supports the same options as the virtual appliance.

    All configuration files can be downloaded in archive. Config files for Nginx are located in the folder as follows: sles15/nginx.

    Place them in the directory /etc/nginx/.

    The service uses names for proxying to specific services:

    • httpd – query proxying to apache;
    • push – query proxying to push-server.

    For configuration to be operational, write the services in local addresses. When services are located on another host, indicate the correct address here:

    echo "127.0.0.1 push httpd" >> /etc/hosts
    

    Start the service:

    systemctl --now enable nginx
    

    Add rules for firewalld:

    firewall-cmd --zone=public --add-service=https --permanent
    firewall-cmd --zone=public --add-service=http --permanent
    firewall-cmd --reload
    


    PHP configuration

    This installation version has centralized configuration storage: /etc/php.d.

    It requires such settings as a minimum:

    • for the module opcache:

      opcache.max_accelerated_files = 100000
      opcache.revalidate_freq = 0
      

    • add settings bitrexenv.ini:

      display_errors = Off
      error_reporting = E_ALL
      error_log = '/var/log/php/error.log'
      
      ; Set some more PHP parameters
      enable_dl = Off
      short_open_tag = On
      allow_url_fopen = On
      
      # Security headers
      mail.add_x_header = Off
      expose_php = Off
      ...
      

    All configuration files can be downloaded in archive . Config files for PHP are located in the folder as follows: redhat8/php.d.

    Place them in the directory /etc/php.d/.



    Apache configuration

    By default, Apache is configured for default site in the catalog /var/www/html.

    The main setup is required for Apache config is as follows:

    • update catalog for the site at var/www/html/bx-site;
    • update port that service listens (because nginx is used as an external service);
    • import site settings from virtual appliance.

    All configuration files can be downloaded in archive . Config files for Apache are located in the folder: redhat8/httpd.

    Place them in the directory /etc/httpd/.

    Configure these files:

    • conf.d/default.conf – replace directory in site description to conf/httpd.conf;
    • conf/httpd.conf – replace the port to 8090 in Listen;
    • conf.modules.d – change to 00-mpm.conf.

    PHP module for apache operates only with prefork process manager. Enable it.

    Start the service

    systemctl --now enable httpd
    



    MariaDB configuration

    MariaDB configuration requires executing the following settings:

    • transaction-isolation update to READ-COMMITTED;
    • innodb_flush_method set as O_DIRECT (preferred, but optional setting);
    • innodb_flush_log_at_trx_commit set as 2 (preferred, but optional setting).

    All configuration files can be downloaded in archive . Config files for MariaDB are located in the folder: redhat8/my.cnf.d.

    Place them in the directory /etc/my.cnf.d/.

    Start the service:

    systemctl --now enable mariadb
    

    Service setup is executed via mysql_secure_installation.



    Push-server configuration

    The setup:

     
    -----------------------                                   ---------------------------------------------------
    | nginx: 0.0.0.0:80     | -> /bitrix/sub|/bitrix/subws -> | node server.js --config push-server-sub-80XX.json |
     -----------------------                                   ---------------------------------------------------
    
     -----------------------                     ---------------------------------------------------
    | nginx: 127.0.0.1:8895 | -> /bitrix/pub -> | node server.js --config push-server-pub-90XX.json |
     -----------------------                     ---------------------------------------------------
    

    Nginx proxies query to push service of selected type. Message getting queries (for example, sub) are public and proxied from standard ports 80/443. Publication queries (pub) are available only from internal server address.

    Nodejs processes are split into two types:

    1. Processes responsible for connecting user to selected channel and message reception. Listen to ports: 8010-8015;
    2. Processes responsible for sending message to channel. Listen to ports: 9010-9011.

    To start Push-server we need:

    • nodejs & npm ;
    • service and its modules archive.

    For installation we require Python or a make utility:

    dnf install python3 make -y
    

    Execute the following actions:

    1. Download and install archive push-server-0.3.0.tgz:

      su -
      cd /opt
      wget https://repo.bitrix.info/vm/push-server-0.3.0.tgz
      npm install --production ./push-server-0.3.0.tgz
      

      Note: If repository repo.bitrix.info is unavailable, download the archive push-server-0.3.0.tgz and deploy it to the directory /opt. Then execute:

      su -
      cd /opt
      npm install --production ./push-server-0.3.0.tgz
      

      Installation will finish with string:

      + push-server@0.3.0
      added 65 packages in 46.522s
      

    2. Execute (exclusively for convenience):

      su -
      ln -sf /opt/node_modules/push-server/logs /var/log/push-server
      ln -sf /opt/node_modules/push-server/etc/push-server /etc/push-server
      

    3. Copy service files and the main configuration:

      su - 
      cd /opt/node_modules/push-server
      cp etc/init.d/push-server-multi /usr/local/bin/push-server-multi
      cp etc/sysconfig/push-server-multi  /etc/sysconfig/push-server-multi
      cp etc/push-server/push-server.service  /etc/systemd/system/
      ln -sf /opt/node_modules/push-server /opt/push-server
      

    4. Create temporary directory:
      echo 'd /tmp/push-server 0770 apache apache -' > /etc/tmpfiles.d/push-server.conf
      systemd-tmpfiles --remove --create
      

      Edit config file /etc/sysconfig/push-server-multi. The following parameters must be corrected/added:

      • SECURITY_KEY - secret key for connection signature between customers and push server;

        Note: Key length doesn't matter. The key can use only Latin letter and numbers, special characters are prohibited. But, be advised, that a too short of a key is unsafe. It can be generated as follows:
        cat /dev/urandom |tr -dc A-Za-z0-9 | head -c 128

      • RUN_DIR - director for process PID file storage.
      • USER/GROUP - user that launched the service.

      Example of parameter settings:

      GROUP=apache
      SECURITY_KEY="SECURITYKEY123456"
      RUN_DIR=/tmp/push-server
      

    5. Each nodejs process is launched as separate process. Generate the configs:

      /usr/local/bin/push-server-multi configs pub
      /usr/local/bin/push-server-multi configs sub
      

      Generated configs in the format [dw]json[/dw][di]push-server-sub-80XX.json
      push-server-pub-90XX.json[/di] will be located in this directory: /etc/push-server/.

    6. Update the user and path to script in the service config file /etc/systemd/system/push-server.service:

      [Service]
      User=apache
      Group=apache
      ExecStart=/usr/local/bin/push-server-multi systemd_start
      ...
      

    7. Update access permissions for directory with logs:

      chown wwwrun:www /opt/node_modules/push-server/logs /tmp/push-server -RH
      
    8. Reconfigure:
      systemctl daemon-reload
      
    9. Start the service:
      systemctl --now enable push-server
      
    10. Go to push module config (site settings) and enable local push server (latest version). Additionally, indicate SECURITY_KEY parameter, configured previously above in the file /etc/sysconfig/push-server-multi.


    Development only option

    Development Only option

    Starting from version 16.5.7 and higher, Bitrix24 editions have a new Development only special option available at newly created and already existing instances. It can be enabled at Desktop > Settings > System Settings > Module Settings

    This option allows to perform testing without installing Bitrix24 Self-hosted instance locally: now several developers can access a single developer Bitrix24 Self-hosted instance without [dw]ERROR_WRONG_CODE[/dw][di]Product update system is associated with a specific instance and "memorizes" system status after the latest update. ERROR_WRONG_CODE occurs in case when the current status doesn't match with the status when the latest update was performed.
    Learn more...[/di]. Also this feature is tailored for situations when several developers are working on a project and they are all require a dedicated Bitrix24 Self-hosted instance for testing.

    Attention! It is futile to attempt to trick the system by switching on and off this option, because all switches to Developer only mode are traced. Using this mode as an operational site (for everyday use) is prohibited. When necessary, Bitrix24 can disable this option, and in case of severe violations, a commercial licence key can be blocked as well as the product updates available retrieved using such licence key.

    The most optimal procedure is to enable this option during the whole development and testing period at the required Bitrix24 Self-hosted instance and do not disable it. When any development updates are finalized, this Bitrix24 Self-hosted instance can be deleted, or removed from active use until new updates must be developed. In this case, a full backup from active Bitrix24 Self-hosted instance can be restored for this testing instance.

    Please, use this option for handling Bitrix24 test instances only to avoid these instances being blocked by the update system.

    Enabling the Development only option shows several notifications in the administrative section:

    • Platform Update section (Marketplace > Platform Update ):

    • on each site administrative section page:

    Enabling the feature

    This option can be enabled:

    In the site administrative section Update system tab inside an existing Bitrix24 Self-hosted instance ( Settings > System Settings > Module Settings > main module > Update system):


    Marketplace applications

    Options for expanding system features

    Bitrix24 product features can be supplemented by using various applications from Bitrix24 Marketplace catalog when standard methods aren't not enough to solve the required objectives.

    By using Marketplace applications you can easily add unavailable product features. You can view free/commercial as well as recommended/discounted apps in the Marketplace catalog listed inside the Bitrix24 portal admin section (Marketplace > Solutions via icons with app names.

    Please be advised that listed apps are created by Bitrix24 Partners and not by the Bitrix24 vendor.

    Attention! Bitrix24 is not liable for software solutions developed by third party developers. Please contact the respective developers for all questions regarding third-party solution operational issues, as well as site stability issues caused by incorrectly operating third-party solutions.

    Installation of new applications is quick and doesn't require additional knowledge or skills.

    Attention! All solutions from Marketplace are installed only oni>Bitrix24 Self-hosted instances with active updates period (with active licence). You can check status of your licence key in the Platform Updates menu of your account's Control Panel or at the Bitrix24 website.



    Unistalling the applications

    Only account administrator can delete previously installed applications

    The Marketplace> Installed Solutions shows the complete list of all installed or even deleted applications:

    Click [dw]Delete[/dw][di][/di] to remove application from the app list.

    The app will be deleted from the account and this app page will show the Install button.


    Registration procedure

    Before you start using the commercial version, you have to activate your license key. If you install the trial version, you can omit registration yet it is recommended that you proceed to enable system updates during the trial period.

    Registering a commercial version

    Attention: According to the license agreement, one key allows only two installations of the system: a public installation and a local (developer) installation, the latter being unavailable from the Internet. Should an error message appear about exceeding the acceptable number of product installation please contact Helpdesk.

    Registration

    Registration entitles you to obtain latest system updates and receive support from the Bitrix technical support service.

    Moreover, having your commercial copy registered you can access the Bitrix private forum where users and Bitrix developers communicate and discuss important issues, resolve user's problems.

    To register your copy:

    • Open Control Panel.
    • Click Marketplace > Platform Update to open the system update form.

    Since your copy is not registered yet, you will see the following error message:

    • Press Activate key.

    You will see the following form:

    Note: fields marked with asterisk (*) are required.
    • Fill in the following fields:
      • Key owner (company name or person): please indicate the name of the company which is the key owner. If a private person owns the key, please provide the name of that person here.
      • Site address: please indicate the addresses of the sites that will be managed using the system with this license key.
      • Phone number of the product copy owner: please indicate the contact telephone number, with the area code, of the product owner.
      • E-mail address for licensing and usage contacts: please provide an email address that may be used by the employees of Bitrix, Inc. to contact you, if necessary.
      • Contact person responsible for this product copy: please indicate the full name of a responsible contact person.
      • E-mail address for technical contacts: please indicate the telephone number of a contact person.
      • Contact person phone: here, you may provide additional contact information: email addresses, mail address, contact telephone numbers, etc.
      • Contact information: here, you may provide additional contact information: email addresses, mail address, contact telephone numbers, etc.
      • Create user at www.bitrix24.com: if you are not a registered user at Bitrix, Inc., please check this box. After the activation of your license key you will be registered on the company website with the registration data indicated in the boxes below. Using the indicated registration data you may contact Bitrix Help Desk and also obtain access to a forum on the company website intended for registered users only.
      • I already have a user account...: please check this option if you are registered at www.bitrix24.com and indicate your login.
    • Click Activate license key. The license will be activated.
    • Then, you have to obtain a full version of the system without limitation on the operating time. Click Register. The product will be registered using the data provided during activation:

    Note: If for some reason, the license key has already been activated, you will be offered to register the product in the update system.

    When finished, the license information will be available:

    Registering a trial version (DEMO)

    Licence key

    If you install the trial version, you will see the License key is not found message when opening the Marketplace > Platform Update page.

    Essentially, a local trial version does not require that you obtain a license key. It only enables the system to receive updates. Obtaining a trial key requires that you register at the Bitrix web site.

    Click Get a trial license key. This will open the trial registration page at the Bitrix web site.

    Note: fields marked with asterisk (*) are required.

    Fill in the form fields:

    • Last name, Name: specify your last and first names;
    • E-mail: specify your e-mail address. The trial key will be sent to this address;
    • Company: the company name;
    • Phone: the phone number;
    • Web-site: specify the exact address of a site that runs the trial version of the system;
    • License type: select the version of the product you have just installed.

    Complete the form and click Send. The system will inform you that your request is now put in the submission queue.

    A message containing the license key and the period of validity will be sent to the address you have previously specified in the trial registration form. You can copy and paste this key in the Control Panel form where you clicked the Get a trial license key link, or in the Kernel module settings page.

    • Open Control Panel.
    • Open the Kernel module settings page: Settings > System settings > Module settings.
    • Open the Update System tab.
    • Paste the key in the License Key field.

    Now you can obtain updates during the 30-day trial period.

    Note: If during the installation of the trial version of the product on the step Product registration you check the option I want to register my copy of the product and get updates and provide data for the registration of the trial version, then there will be no link to Get a trial license key after the installation of the product. Thus, the trial version will be activated for 30 days.

    Registering a trial version using a commercial key

    Bitrix24 commercial version

    Having tried the demo version of the product you can register it and upgrade it to the commercial version.

    To do so, you have to:

    • Buy the license.
    • Introduce your license key:
      1. On the tab Install updates (Marketplace > Platform Update), by clicking Enter license key.


      2. or

      3. On the tab Update system of the setup page Kernel module (Settings > System settings > Module settings > Kernel module) in the License key box.
    • After that, the key activation process shall be launched according to the instructions given in the lesson Registering a commercial version. Upon the completion of commercial registration, the demo version limitation on the operating time will be lifted, and you will obtain the full product.

    Update system

    The system updates, like the technical support, are available within a year after the moment of registration of the purchased license. If you want to access these services after that period, you will have to renew your license.

    Attention: For each installation of Bitrix24, a special token is stored in the Bitrix clients database. When a project is moved to another location (server), the token is replaced once the system requests the Bitrix server for updates for the first time from the new location. Since then, you cannot update the system from the old location.

    Your computer must be connected to the Internet to receive updates.

    Overview

    Update system

    The update system serves to interact between and transfer data from the update server to a client (installed product copy). The main types of interaction are:

    • updating the product modules to the newest versions, which allows to obtain new functionality and fix possible bugs;
    • downloading new modules that may be available according to the license terms;
    • downloading language files (files with language-dependent messages translated into other languages);
    • downloading the help system in different languages;
    • product registration using the license key;
    • downloading the Bitrix Self-hosted or Bitrix24 source code files;
    • obtaining more sites by entering a coupon code.

    Update system terms

    The following terms are used with the update system.

    System core - the /bitrix/modules/ folder (all paths are specified relative to the root folder unless otherwise is explicitly stated). The notion of system core often implies the database structure.

    Service area - all subfolders of the /bitrix/ folder except /bitrix/modules/ (i.e. the system core) and /bitrix/updates/. The notion of service area often implies the contents of the auxiliary database tables (for example, b_event_type).

    Update system folder - the /bitrix/updates/ directory. This folder is for exclusive use by the update system and cannot be used otherwise.

    Public section - all folders related to a given  product copy save the system core, service area and the update system folder. The notion of service area often includes the database contents except for the data of the auxiliary tables.

    Product registration - results in removing the trial version restrictions from a given product installation (e.g. time restriction).

    License key - a special key (a chain of symbols) which is the statement of the right to use the given product copy.

    Site coupon - a special key allowing to create one more site using the given product copy.

    Update server - a server that is used to send bits of update data to the update system. The update server address can be explicitly specified on the module settings page (must be www.bitrix24.com).

    Important notes on the update system

    The update system does not alter the public section in any way. The service area may be changed in case of absolute necessity; but even so, existing files and records remain since they might have been changed by a user. The system core can be modified extremely, but the backward compatibility is guaranteed.

    Important! If you have changed even one file of the system core or the database structure manually, the automatic update may cause unpredictable results.

    The update system does not collect or send any confidential data regarding the installed product copy. The update system and the update server exchange only the technical data which is required by the update system to function correctly (e.g. current module versions or last update dates).

    The modification that the update system performs on the system core is technically complex and intricate. If it fails or completes with errors, the dependent sites may become inoperative. Before update, you are recommended to ensure that a back-up copies of the database, scripts of the system core and the service area are created. It is desirable to perform update when the server load is minimum. If you encounter update problems, you need to contact the Bitrix technical support service immediately.

    The update system main page

    You can open the update system page by selecting Marketplace in the top left menu, and then choosing Platform Update.

    If you see a message showing that your license key is invalid (or the license is not found), the following reasons are possible:

    • if you already have a license key, enter it in the appropriate field on the update system main page (or on the Kernel module settings page: click Settings on the top toolbar and select Kernel in the drop-down list);
    • if you do not have a license key, you can send a request for a trial key. To do so, click the corresponding link on the update system main page. Enter the obtained key in the appropriate field on the update system main page, or on the Kernel module settings page.

    If the update system main page displays a message reading that a license key is not activated, you have to fill in all the fields of the activation form. After you complete and send the form, the license key will become activated.

    The update system main page may tell that a new version of the update system is available, you must install it first. You will not be able to proceed with other updates until you install a new version of the update system.

    If you have already provided a valid license key, and the update system is up-to-date, the update system main page will offer the following actions which are available according to your license terms.

    • Recommended updates - this action is available if the update server can offer new versions of modules stipulated by terms of your license.
    • Optional updates - available if the update server can offer new versions of files containing language-dependent messages.
    • Register your copy - displayed if your copy is not registered but the current license permits registration. You must register your product copy immediately after you have received the license key, since it will be difficult to restore the site up-state after the trial period expiration. The product registration is a single step operation - all you have to do is click the link.
    • Download source code - available if the source codes of your product copy are enciphered but the current license permits obtaining full open source codes. Before you attempt to download them, you must ensure that all modules are updated to the latest version (i.e. no module updates should be available). Source code download is a one-click operation. Please note that download may take some time if your connection is slow, or the update server load is high.
    • Add extra sites - this action is always available. If you have a coupon for extra sites, you can apply it any time.
    • History of updates - displays the installation journal containing information about 20 recently installed updates including status and error messages.

    Update via proxy server

    Update system

    You can configure the update system to communicate via proxy server on the Kernel module settings page (the Update system tab), Settings > System settings > Module settings, select Kernel in the drop-down list:

    Note the following options.
    • Force exhaustive update integrity check. Enabling this option makes copying the update files more safe. This function may slow down the update process but allows to get full information about each new file copied to your system.
    • Download only stable updates. Some new modules and/or updates are available at beta testing stage. Changing this option is equivalent to clicking the Allow beta versions / Allow only stable versions button at the Marketplace > Platform Update > Settings.
    • Check for updates. You can completely disable autochecking if required. However, it is not recommended.
    • Stop autochecking for updates if an error occurs. If checked, this option tells the update system to stop any current operation whenever it encounters any error.

    After you fill all the required fields and save settings, the update will be performed via the specified proxy server.

    Update system via proxy operates based on the following principles:

    • All data exchange with server is performed using HTTP protocol.
    • Responses are compressed via gzip (when supported by your PHP).
    • Licence key is passed in an encrypted format (specifically, passes the hash key).
    • Sends licence associated data: number of sites, number of users, set of modules and module versions.
    • Sends PHP versions and database information as well as site encoding data.
    • Update system does not collect ant user data.

    Additional security measures

    When required, network administrator can establish additional security measures:

    • Connect proxy server to the network only during update download time.
    • Configure proxy for connecting to site with updates using SSL.
    • Enables full traffic logging on server.
    • Block access from proxy to all URLs, except for www.bitrix24.com.

    Downloading Updates

    The update system performs a technically sophisticated modification of the product kernel. If this modification is made improperly, the sites working on that kernel may become inoperative. Should you experience any problems with updates, you have to contact our Help Desk team immediately.

    Important: Before proceeding with updates, please make sure you have a backup of both the database and the product kernel and service area scripts. The update procedure should be carried out at a time that the server load is minimal.

    Please follow the steps below to download system module updates:

    • Using the Notifications menu located on the administrative panel above, go to the page Site Update (Marketplace > Platform Update):

    • Click Install recommended updates to install all the system module updates.

    If you choose not to install all the updates at once, please check only the updates you wish to install on the tab Updates and click Install updates.

    If necessary, the update process may be stopped by clicking the Stop button. In this case, the system will not interrupt the update immediately and fully but will complete the downloading of the module that was being updated when the Stop button was clicked. Should any failure occur during installation, the system will notify you about it, and the process will just have to be repeated. If you update modules one by one rather than all at once, then after you have installed each “portion” of the modules you will have to click Check for updates and then install the chosen modules.

    Important: If any related module updates are available, either all related modules must be chosen for an update or none of them. The elimination of one related module from the list of updates will result in the automatic elimination of all others.

    Attention: Please read the module update descriptions carefully. They contain important information about update installation; they also may contain warnings about possible problems in operation.


    Downloading Interface language Files

    You have an option to install additional user interface languages.

    • Click the Updates tab;
    • Select the required languages in the optional updates group;
    • Click Install Updates.

    Coupon activation

    Bitrix24 Self-hosted

    When acquiring licenses for additional users you will be given a coupon for the required number of portal users. Additional licenses (and coupons, accordingly) do not depend on the portal version.

    If you already use commercial Bitrix24 version, you can expand your portal features by upgrading the product. To do so, you need to acquire a coupon for upgrading to the version you need.

    Coupon activation

    In order to have access to the latest product updates and technical support at all times, the coupon for extended technical support and updates must be acquired upon completion of the update availability period.

    Having received the coupon, you need to activate it as follows:

    • Open the page SiteUpdate (Marketplace > Platform Update).
    • Go to the tab Activate coupon.

    • Enter the coupon in the relevant box and press Activate coupon.

    Common errors

    While attempting to update, the error "Error connecting the update server: [110] Connection timed out" appears.

    This error indicates that the update script cannot connect to update the server www.bitrixsoft.com on port 80. This may occur due to the following reasons:

    • Socket functions are unavailable, particularly fsockopen();
    • Connections to port 80 are forbidden on the server;
    • Insufficient memory on the server (often occurs on VPS with virtualization OpenVZ and 256 Mb RAM);
    • Network problems.

    Please contact the server administrator and provide them with the error description.

    Update error [SITE_LICENSE_VIOLATION] Number of licensed site exceeded

    This error indicates that either no sites were registered in the system, or all sites are deactivated, or number of active sites, permitted by the current licence has been exceeded.

    Register at least a single site to solve this issue and to allow to download and install updates. You can also activate an existing пышеу from the same section or deactivate number of sites until your instance has the number of sites permitted by your current licence: Desktop > Settings > System Settings > Websites > Websites.


    Update error [ERROR_WRONG_CODE]

    The product update system becomes related to a specific installation and “remembers” the status of the system after the latest update. An error occurs if the current status is inconsistent with that at the time of the last update. This feature is intended to prevent the update attempts of an unlimited number of product installations using one license key.

    According to the license agreement, two system installations are permitted for each license key – one public and one local (for developer) installation, the latter being inaccessible from the Internet. Accordingly, the system is set to save data about two installations. In this case, two copies may be updated independently without any problems and without the need to move a copy from a local computer to the server and back. If you have to move the product to a local computer, only one of two copies should be updated – either that on the server or the local one (at your discretion).

    The same procedure should be followed when moving your site to a new server. Copy file structure and database onto a new server, and after that, without updating the product on the old server, delete it immediately after updating the DNS.

    Configuring IIS for use with the system

    IIS 7.0, a new web publication service, comes as a part of Microsoft Windows Server 2008. The key difference of this version, as far as work with Bitrix Framework is concerned, is the use of FastCGI, a request queue, and also the abandonment of nginx. Installation and setup of Bitrix, Inc. products on servers with Windows OS has become much simpler.

    There are no significant differences in the installation of the Bitrix Framework onto IIS comparing with the installation on Apache. Only a general sequence of actions changes:

    Attention: Currently, the Document library (webdav) module works improperly on web servers controlled by IIS 7.x. The architecture of such web servers in its basic variant does not permit organizing the work of PHP scripts according to the WebDav protocol – the server picks up all the requests and they fail to go through to the Bitrix24 system.

    PHP Installation and Setup

    In order to install PHP, first of all the PHP 5 installation package shall be downloaded from http://windows.php.net/download/ (Microsoft recommends a Non-thread-safe (NTS) installation package to be used).

    Launch the installation package and follow the instructions of the Setup Wizard.

    First Step (Installation Start)

    The first window of the Wizard informs about the commencement of the installation and provides information about the product.

    Click Next.

    Second Step of the Wizard (License Agreement)

    Read the license agreement carefully. If you agree with its terms and conditions, check the box I accept the terms in the License Agreement.

    To proceed with the installation please click Next.

    Third Step of the Wizard (Directory Selection)

    Please choose the directory to install the software and click Next.

    Fourth Step of Installation (Web Server Selection)

    Please select IIS FastCGI as the installation web server and click Next to proceed with the installation.

    Fifth Step of the Wizard (Component Selection)

    Include the necessary Extensions (PHP add-ins) to be installed:

    • GD2;
    • LDAP (in case you will use LDAP authorization);
    • Multi-Byte String (this extension is required if product is to be used in the UTF-8 encoding);
    • MySQL;
    • OpenSSL;
    • zip.

    Note: said extensions may be manually added later as extension=name_of_extension_file.dll in the file php.ini in the folder where PHP was installed. For example: extension=php_win32scheduler.dll.

    To continue the installation, please click Next.

    Sixth Step of the Wizard (Installation)

    Click Install to start the installation process:

    Please wait while the Setup Wizard copies and installs files.

    Seventh Step of the Wizard (Completion of Installation)

    PHP has been installed successfully. Please click Finish to exit the Wizard.

    PHP Setup

    PHP must be setup immediately after its installation:

    • Go to a folder where PHP was installed using any file manager.
    • Open php.ini for editing.
    • Please set the following parameters:
      fastcgi.impersonate = 1
      cgi.fix_pathinfo = 1
      cgi.force_redirect = 0
      short_open_tag = On
      extension_dir = "C:\<path_to_folder>\PHP\ext"
      upload_tmp_dir="C:\inetpub\temp"
      session.save_path="C:\inetpub\temp"
      allow_call_time_pass_reference = On
      display_errors = On

      Note: In Bitrix24 Self-hosted <? is used instead of <?php.

      Note: inetpub means a location where sites will be placed. This folder exists by default.

    Please do the following to check the PHP setup:

    • Go to Start > Run;
    • Open command prompt window using the command cmd;
    • Once in the command prompt window, go to a folder with PHP using the following command: cd C:\<path_to_folder>\PHP\;
    • Give the command info to php: php –info.

    If everything was done properly, the same configuration file will be offered (php.ini).

    FastCGI Module Setup

    In order to improve performance, php files must be processed with the FastCGI module. Please do the following:

    Note: if you set 1 as the parameter of fastcgi.logging in the php.ini file, errors will be output to the log and not to the monitor. It increases the security of PHP.

    Checking PHP

    PHP parameters may be checked as follows:

    • In the folder C:/inetpub/wwwroot create a file phpinfo.php containing the line:

      <? phpinfo(); ?>
    • Type the following in the browser address bar: http://<your_portal>/phpinfo.php.
    • If setup is done correctly, opens a standard page containing information about PHP:


    Preparatory Operations

    Preparation of the Installation Package

    Download the product installation package as a zip-archive.

    Create a folder for the extraction of the installation package in the folder C:\Inetpub\wwwroot\ (or in another folder you determine as a root folder of the web server). For example: C:\Inetpub\wwwroot\bitrixtest and extract the contents of the archive to this folder.

    Open the Properties form of the folder C:\Inetpub\wwwroot\bitrixtest and add the Modify rights for the group on behalf of which PHP process is launched (in our case, it is IUSRS) in the tab Security.

    Adding a Website

    Using IIS manager on the Connections panel go to Sites and eliminate Default Web Site.

    Note: you may keep the default website, but in this case you will have to change the port settings for one of the sites during the setup of a new site.

    Right click to call the context menu and click Add Web Site

    The window for adding a new site will open:

    In the Site name box please specify the host name (in our example: bitrixtest), and in the Physical path box, enter the path to the folder containing the installation package.

    Click Test Setting…. The system will verify the connection parameters and display a message indicating the errors found, if any.

    As a rule, authorization errors occur due to the user’s insufficient access rights to perform the operation of verifying folder access rights. Please do the following to correct this error:

    Close the Test Connection window. Click Connect as…, and the following window will open:

    Please check the box Specific User and press Set…. Enter the login and password in the window that opens. Click OK.

    Verify the connection parameters once again using the Test Setting… button. If the verification is successful, the system will show the following message:

    Configuration of Limits

    Now, a time-out must be set. For this, do the following:

    Please activate bitrixtest in IIS Manager on the Connection panel. The Action panel will be refreshed. Choose Limits in the Configure group.

    The limit setting form will open.

    In the box Connection time-out (in seconds) type 600. This command establishes an intentionally long timeout for the web server while it waits for the script to complete its operation – 600 seconds.

    Open the file php.ini for editing and specify the following values: max_execution_time = 240 and max_input_time = 240.

    Note: the indicated values may be user-defined depending on your hosting parameters.

    mimetype setup for files without extension

    Additional IIS 7.5 settings for mimetype is required for files without extension, otherwise video player won't be working in the installed product. To avoid this, add '.' extension with type video/x-flv in mime types inside server settings.


    Configuring The Error 404 and SEF URL’s

    SEF URL’s are implemented by handling a 404 error.

    • Select bitrix in Connections of IIS Manager. Activate Error Pages in IIS group.
    • Right-click the row containing the error 404 to bring up the error properties form.

    • Click Edit

      Click on image to enlarge
    • Select Execute a URL on this site. Type the error 404 script path in URL: /404.php. This file is created at the product installation time. Click OK.

    • Click the Edit Feature Settings…

      Click on image to enlarge
    • Check the Custom error pages option. Click OK.

    Backup and restoration tools

    Using the back-up and restoration built-in tools

    Creating backup

    A special backup feature may be used to move the site to a remote server (or from a remote server to a local computer).

    Please note: The backup feature may only be used for an MySQL database.

    Before moving the site from a local computer to a remote hosting or from one remote hosting to another using the incorporated backup function and special script restore.php, it is necessary to do the following:

    • Verify that:
      • The remote hosting meets the minimal technical specifications of the product;
      • The user under which Apache (PHP) operates has the rights of at least (0644 – for files and 0744 for folders) for all files in the site root.
    • If an active license is available, it is strongly recommended that the existing product copy be updated to the latest version.

    The next step is the creation of a site archive. The archive may be created on the Backup page (Settings > Tools > Backup > Create Backup).

    After that, you may proceed with the actual site moving. Please follow the steps indicated below:

    • Download the file containing the archive to the site root directory on a remote server or on a local computer depending on where you moving the site to and from. If the source site is available on the Internet, it is recommended for the archive to be downloaded from a remote server. In this case, all parts of the archive are downloaded automatically. In case of moving from a local computer to a hosting all parts have to be brought together using restore.php.

      Important: if the archive file contains complete site copy (both the kernel and a public part), there is no need to install Bitrix system on the server.

    • Download the restore.php script available through the link provided in the reference at the bottom of the page with backup list. Upload the script to the site root on the server.

    • Note: This link contains a script that corresponds to your installation package version. The latest version of the script is available at bitrix24.com.

    • Please type in the address bar: http://your_site/restore.php. Press Continue.

    • Please choose the required option of the archive file location in the dialog window that opens and click Continue.

    • Note: The options Archive is stored in document root folder and Archive is already extracted will appear when the archive has been copied or extracted to the site root, accordingly.

      Note: If the site archive was located in the client’s cloud, please choose the option Download from remote server and indicate the path to the archive:

      If the site archive was located in Bitrix Cloud, please select the option Restore the backup from Bitrix Cloud and enter your active license key:

    • After the archive is downloaded, you will be requested to enter a password (if the archive was protected at the backup stage) in order to extract the files.
    • After the files are extracted, the database connection settings must be established if a database dump was created during the preparation of the backup copy.

      Please indicate the required settings, click Restore and wait for the script to complete its operation.
    • Once extraction is successfully completed, click Delete archive and temporary scripts in the opened dialog box:

      The following files will be deleted to prevent damage to the site or information leak:
      • /restore.php
      • /backup file (file with an extension of .tar.gz or .enc)
      • /bitrix/backup/database dump (file with the extension .sql).
      After that, you will be automatically redirected to a public section of the recovered site.

    Special considerations:
    • If IIS is used as a web server, please be advised that the web.config file is also archived. You have to delete the extracted web.config file. Your server will create a new customized file.
    • After migration, numerical control may become inoperable. In this case, .htaccess.restore has to be renamed .htaccess.

    Possible Errors during Migration

  7. Site Migration Using Improper Means
  8. PHP Settings
  9. Problems with Email
  10. Extracted Site Is Unavailable
  11. Incomplete Archive
  12. ERROR 1062 (23000)
  13. Errors in .htaссess
  14. If IIS is Used as a Web Server
  15. Site Migration Using Improper Means

    The migration of site to hosting should be performed using backup/restore tools built in Bitrix Framework.

    Although a site on Bitrix24 Self-hosted is a set of files and a database, copying of files directly to a remote server in most cases will not be a proper solution. Due to a big number of small files, such copying may take several hours. In addition, the use of standard features enables the avoidance of possible future problems with access rights to the site files.

    Among the most common problems are the following:

    1. Web server cannot write to a folder that it needs to or delete temporary files. Possible consequences:

      • Product update is impossible;
      • Site cannot be edited using a web interface;
      • Caching component works improperly;
      • And other problems.

        Note: For example, the system may even create temporary files, but hosting rights do not allow you to delete them. As a result, after a day of work, the account gets blocked because the disc quota is exceeded.

        In this case, the simplest solution will be establishing the rights to all files and folders 777 (for Unix platform) or provide PHP with the write right for these files in any other way.

    2. There is no possibility to edit the files created using a web interface through ftp/ssh files. In this case, it will be hard for many web developers to debug the site.

      One of the simple but not always effective solutions is to determine settings in the file dbconn.php permitting everyone to edit the files created through Bitrix Framework.

      define("BX_FILE_PERMISSIONS", 0666);
      define("BX_DIR_PERMISSIONS", 0777);

      However, you will have to periodically change the rights manually for the files created through ftp/ssh; or, if hosting supports it, to establish the umask setting.

    PHP Settings

    The following problems may occur during the migration of the site to hosting due to the PHP settings:

    • Problems with file owner inconsistency: on a number of hosting PHP works on behalf of one user, but ftp/ssh access is granted to another. In this case, the files created by one method may be unavailable for modification or even cause a runtime error due to a breach of the security settings.
    • Problems with security settings: there are different options to connect PHP, and some of these options establish severe restrictions on the file owner and file rights. In this case, code 500 errors may occur, and the only way for you to solve the problem is to refer to web server error log.

      Example: If PHP is connected as CGI, hosting often requires that the file owner and file rights were consistent. If your account is not the file owner or if the file rights permit writing to all users, PHP will generate an error. In this case, the correct rights to files and folders and also the correct settings in dbconn.php should be established.

    • Limits to the script execution time or other allocated resources. In this case, the site may act strange –sometimes it may open, and sometimes not and then show white screen.

      Example: Various scripts of data import and export are the most sensitive to memory size and execution time. If you experience errors, check hosting resource availability. If the resources are insufficient, change the hoster.

    • Problems with using utf-8 in hosting. Make sure that it is supported (mbstring library and a possibility to set the parameter pgp: mbstring.func_overload=2 must be available).
    • Other problems that are specific for your hoster. To eliminate them, we recommend that the site operation be tested beforehand in the hosting of your choice and that the contact details of the provider’s support team be available.

    Problems with Email

    Sometimes hosting does not permit sending email without authorization. In this case, you will have to redefine email sending function in accordance with the product documentation in order to send emails from the site.

    Extracted Site Is Unavailable

    After extracting a backup copy, the only thing shown on the site is the authorization form. Possible reasons and solutions:

    • Incorrect value of the box Path to the web server root folder of this site in the site settings (Settings > System settings > Websites > Websites).

      Solution: change the value in the box Path to the web server root folder of this site in the site settings to a relevant path in a new hosting by clicking insert current. Leave the box empty if all the sites work on the same web server.

    • If migration was carried out by a simple copying of files (FTP/SSH), the file .access.php may have been left uncopied. This file contains user groups’ access rights to the site. If this file is absent, all users have the right Forbidden.

      Solution 1: Put the file .access.php with the contents to the site root:

      <?  $PERM["/"]["*"]="R"; ?>

      or

      Solution 2: Establish the right Read for the All users (with non-authorized users) group using product’s file manager in the properties of the site root folder in the Access tab.

    Incomplete Archive

    When looking through WinRar, the archive created by the standard backup system, it becomes evident that the archive contains far fewer files than there are files on the site.

    Reason: the point is that the tar format has several dialects. The system zips archive in the format GNU tar the way tar does it in Linux by default. WinRar understands tar, but does not support this dialect in full.

    Backup archive must be extracted by the system restore.php downloaded from the backup copy page. If in this case some files are also missed, the problem should be solved through the helpdesk service.

    ERROR 1062 (23000)

    When extracting a backup copy, the following error occurs: ERROR 1062 (23000) at line 1247: Duplicate entry '2-?' for key 2.

    Reason: the error occurs if the encoding of the archive is different from the encoding used on the new database server.

    • Archive encoding is set depending on the contents of the file /bitrix/php_interface/after_connect.php, for example:
      <?
      $DB->Query("SET NAMES 'utf8'");
      ?>
      i.e. the archive will be created in the utf8 encoding.
    • Database server encoding may be seen in the parameter character_set_server following the execution of a SQL request:
      show variables where Variable_name = 'character_set_server';

    This error may be bypassed or eliminated by way of one of the following ways:

    • In the new database server settings, change encoding in the parameter character_set_server to the encoding used in the archive.

      Attention: you might want to contact server administrator to perform this operation.

    • Open the archive in a text editor and insert the following line at the very beginning:
      SET NAMES 'utf8';
      The encoding is chosen depending on the archive encoding.

      Attention: this solution works only in case of small dumps (which manage to import in one step).

    Errors in .htaссess

    Some errors (for example, error 404 when going to a page with detailed news information) during site migration occur because the file .htaссess is getting renamed by adding “_” (low line). In order to solve this problem, just check the file name and correct it if the error is detected.

    If IIS is Used as a Web Server

    In this case, the file web.config is also archived causing problems with extraction. After extraction, restore.php will not work.

    Solution: eliminate the extracted file web.config. The server will create a new customized file.


    Transfer to hosting

    Migrating your website to a remote hosting

    To migrate the site to a remote server or vice versa, use the Backup feature. With this function you can:

    • choose an appropriate sequence of actions depending on the server's hardware (local backup or cloud backup);
    • create a backup of files on your site ();
    • include or exclude the system kernel folder;
    • include or exclude the public area;
    • exclude files exceeding a user specified size;
    • create a database dump (a .tar.gz archive, or an encrypted .enc archive);
    • exclude statistics and search index tables from the database dump;
    • specify backup step and interval lengths to reduce system stress;
    • create uncompressed archive to reduce system stress;
    • check the archive for integrity.

    Note: the backup feature is supported for MySQL database only.

    Bitrix and hosting

    Bitrix Framework hosting requirements

    • Your server has to have an adequate free disk space. A typical project involving a lot of image files requires 300 MB minimum. Remember that a typical full size photo file in JPEG format may take over 1MB on disk)

    • Common server resources should include a PHP accelerator and have to specify sufficient amount of memory for scripts. At least 128 MB available for PHP is required to run full-scale projects like online stores. This memory is used to prepare data and run code when the system prepares a requested page.

    • High load projects are strongly recommended to have a two-tier architecture. It is usually achieved by installing an intermediary web server to serve inbound requests, like NGINX. This approach will make memory consumption stable by reducing the number of simultaneous Apache processes.

    • The database server has to be fast enough to process requests in the shortest time possible.

    • PHP and FTP/SSH are recommended to run as the same user if possible. During the site development phase the developers upload, create and edit remote files using the FTP or SFTP protocol. However, the system creates and updates files on behalf of a user running the PHP instance. ПThis kind of user mismatch can cause serious issues.

    • The server needs to have free disk space three times as large as a backup file for recovery operation to succeed.

    Selecting a hosting provider

    Otherwise, you have to make sure the hosting service of your choice is capable to meet the following provisions:

    • The system can only be installed to the root directory.
    • Apache 1.3.0 or higher is required.
    • The hosting provider allows to use .htaccess files.
    • PHP version not lower than 7.2.0.
    • safe_mode must be disabled; the system installer will simply quit if that's the case.
    • short_open_tag is enabled.
    • memory_limit 32 MB, 64 MB or higher.
    • Sockets are enabled and allowed to use.
    • Libraries: Zlib (compression helper library), GD lib (charting), Free Type (CAPTCHA).
    • MySQL 5.0 or higher, Oracle 10g or higher or MSSQL 10.0 (2008) or higher.
    • Before installing the Oracle version, make sure the client Oracle 10g (or higher) is installed and create a new user.
    • The use of PHP accelerator (OPcache, XCache, APC, etc) is highly recommended. We suggest you use OPcache, it's included in PHP v5.5 and later.

      Attention!
      1. When using XCache precompiler, set xcache.cacher to Off.
      2. eAccelerator is incompatible with PHP v5.3 and higher and not supported by the Bitrix systems since Kernel version 15.0.13.

    • Running PHP as Apache module is preferred (CGI is not recommended because it doesn’t support accelerators. Use FastCGI instead).
    Note: Modules suhosin or mod_security are not recommended because they may cause system malfunction.

    To test your server configuration, run the script bitrix_server_test.php on the server.


    Migrating Bitrix v.12 or higher

    Preparing for migration

    Before you start migrating your site from a local machine to a remote server, you have to engage the Backup function and the restore.php script to make sure:

    • the hosting environment conforms the product minimum requirements;
    • the user running Apache and PHP has permissions at least 0644 for files and 0755 for folders in the site root directory.
  16. If you have a valid commercial license, you are strongly recommended to update the system to the latest version.
  17. Site archive

    Now that you are done with the checks, you can create an archive file with the contents of your site. Open the System Backup page (Settings > Tools > System Backup) and follow the instructions.

    Site transfer

    Once the archive file is ready, you can start actually migrating the site:

    1. Upload the archive file to the root directory on the remote server (or local machine if you're moving the site back for some purpose). If the source location is available remotely, download the file over the Internet to have all the parts of archive fetched automatically (see below). Otherwise, put all the files beside the restore.php file (also see below).

      Important! if the site archive contains a full copy of the site including the kernel and the public area, you don't have to bother and install the system manually on the server.

    2. Download the restore.php, script from the lower part of Backups page (Settings > Tools > System Backups > Backups), you will find the link at the page bottom. Upload the script to the root directory on the remote server.

    3. Note: This link will download the script as per your current system version. The latest version of the script is always available at Bitrix24 website.

    4. 3. Open http://your_site/restore.php in your browser to bring up the [dw]initial page[/dw][di][/di] of the migration wizard. Click Continue.
    5. 4. Select how you would like the script to access the archive file and click Continue.

      Note: Item Archive is stored in document root folder will appear when the archive is copied to the site root folder.

      When downloading archive in cloud

    6. After archive is downloaded, indicate the password (when archive was encrypted at the backup creating stage) to pack the archive.
    7. Once the archive has been unpacked, the next Wizard window will ask you to provide database connection parameters – if you included database dump in the archive file. Indicate the required parameters, click Restore and wait until the procedure is complete.
    8. In the final window, click Delete archive and temporary scripts in the opened window:

      The following files will be deleted for security reasons:

      • /restore.php
      • /archive_copy_file(the one with the .tar.gz or .enc extension)
      • /bitrix/backup/database_dump (.sql)
    9. The recovery operation has been completed.

    Important things to note:
    • If you're using IIS, remember that the web.config file is also added to the archive. You have to delete the extracted file manually. Your server will create a new web.config as required.
    • SEF URL feature may appear broken. Rename .htaccess.restore to .htaccess to fix the issue.
    • If the archive was created on a demo version of the system, the trial period will reset.



    Migrating Bitrix products to BitrixVM or BitrixEnv

    Things to consider

    To migrate a website from a remote hosting, cloud service or a local server to BitrixVM or BitrixEnv virtual environment, you will need two things: a site archive and a properly configured BitrixVM or BitrixEnv instance.

    Let's assume you have already created the site archive it's now resting comfortably in its mancave on the [dw]Backups page[/dw][di][/di] (Settings > Tools > View Existing backups).

    Select the [dw]Get backup link[/dw][di][/di] item in the action menu. This link is only available for locally stored backups. Copy the link to the Clipboard:

    As an alternative, you can download the archive to your computer (select Download in the action menu).


    Site installation in BitrixVM/BitrixEnv

    1. Start up the BitrixVA or BitrixEnv.
    2. Enter http://virtual_machine_address/ in the browser address line (you may indicate a domain or IP address).
    3. Birtix product Installation Wizard will open. Choose the of Restore from the backup option:

    4. When the backup download is in progress, select the required archive storage option (in this case, select the clipboard link, received at the site backup copies page):

      Note: It is also possible to download the archive from Bitrix Cloud (a license key with a valid license is needed) or from a local computer, is these options were selected at the site archive creation stage.

    5. If the archive was encrypted, password prompting appears following the archive download.
    6. After that, a database connection must be set up:

      By default, MySQL connection settings in BitrixVM/BitrixEnv are taken from /home/bitrix/www/bitrix/php_interface/dbconn.php.

      Individual MySQL connection parameters can be indicated - in this case, also select the Create database.

    7. After the database is successfully restored, it is necessary to Delete archive and temporary scripts for security purposes, by clicking on the button with the same name:

    8. The Bitrix product migration to the BitrixVA/BitrixEnv is now completed:


    Error "Call to undefined function mysqli_init()"

    Error "Call to undefined function mysqli_init()" can occur during the transition to a new version of BitrixVA/BitrixEnv platform. Reason: previously, .mysql extension was used in MySQL database (declared obsolete in PHP 5.5.0). Mysqli. extension is used in new versions.

    Solution:

    1. Add in the file \bitrix\php_interface\dbconn.php the following:
      define("BX_USE_MYSQLI", true); 
      
    2. In the file \bitrix\.settings.php:
      'className' => '\\Bitrix\\Main\\DB\\MysqlConnection',
      
      to change to:
      'className' => '\\Bitrix\\Main\\DB\\MysqliConnection',
      
    3. Check the availability in the /etc/php.d/30-mysqli.ini file (or in a similar file):
      extension=mysqli.so
      
    4. Execute a restart of httpd:

      • CentOS 6:
        service httpd restart
        
      • CentOS 7:
        systemctl restart httpd.service
        

    Online chat widget setup with multisite configuration

       General description

    In some cases, customer uses Bitrix24 [ds]Single sign on[/ds][di] Single sign authentication is enabled in the Main module settings (option "Spread authorization across all domains").
    [/di] authentication activated with multisite configuration at the single kernel and for subdomain (for master domain).

    For example, when a customer sends a request via [ds]Open Channels[/ds][di] Bitrix24 Open Channels unify multiple digital communication channels: Facebook, Telegram, WhatsApp, Viber and others.

    Customer queries are accumulated in a single chat and are automatically distributed among responsible managers.[/di] - this action requires different authentication data for different services, causing inconvenience.

    Your online store is located at shop.com domain, but Bitrix24 is located at the subdomain of this shop crm.shop.com with multisite configuration in use. The online store website has the enabled Bitrix24 widget from crm.shop.com.

    With enabled single sign on authentication, upon customer communication via Bitrix24 - this user's current authentication will be updated at the main website (shop.com) and this customer will loose access to customer account, shopping cart with products will be emptied and the website will show error 403, until this customer won't switch to website root.

    To avoid this, disable single sign-on at the online store website with 2-level domain (shop.com).

      Solution

    1. Go to online store website control panel (shop.com): Settings > Service Settings > Websites > Websites , select your website and delete the main website's URL in the field Domain name (in this example: shop.com):

    2. Next, proceed by clearing cookie files for the store website using browser's DevTools (F12 > Application > Cookies: mouse right click > Clear):

    3. Next, specify the following code [dw]in any template location[/dw][di] [/di] of the store website (shop.com): Settings > Service Settings > Websites > Site templates:

      <script>
          window.addEventListener('onBitrixLiveChat', function(event){
              var widget = event.detail.widget;
              widget.setOption('checkSameDomain', false);
          });
      </script>
      

      This code disables additional check for Online chat multisite configuration in Bitrix24 Open Channels module (imopenlines 21.400.0 and higher).

      Note: Find more details about website widget configuration in this article.

    All is ready. Now, both online store and Bitrix24 website will have different authentications and customers will no longer have issues with loosing their shopping cart contents and Open Channel messages.

    Possible site migration errors

  18. Using third party tools to migrate the site
  19. PHP Settings
  20. Possible issues with multisite configurations of Bitrix Framework
  21. Site is unavailable after unpacking
  22. Incomplete archive
  23. ERROR 1062 (23000)
  24. .htaссess related errors
  25. IIS related issues
  26. Using third party tools to migrate the site

    You will get the best results migrating your site by using the standard backup and restore tools included in Bitrix Framework.

    While a Bitrix powered site is essentially a number of files and a database, making a blind copy of the site at another location is not the best way. Thousands of small files will take a very long time to copy over the Internet, and then there is a file permission problem.

    The following are the most frequent issues that can be encountered:

    1. Web server cannot write to a folder or delete temporary files. Potential consequences:

      • inability to install system updates;
      • inability to edit the site via the web interface;
      • cache subsystem malfunction and other issues;
      • Note: some rare situations occur when, for example, hosting service assigned access permissions prohibited the system to delete temporary files it was allowed to create in the first place. As a result, the account will be disabled within 24 hours due to reaching disk quota.

        A seemingly simple solution would be assigning 777 permission to all files and folders on Unix platforms (or any other method allowing PHP to read and write wherever it wants to). Obviously, not the most secure solution of all.

    2. Users may be unable to edit via FTP/SFTP the files created in the web interface. This will make updating the site extremely troublesome.

      One of the simplest but not very reliable solutions is setting permissions in the dbconn.php, file enabling anyone to edit files created by means of Bitrix Framework.

      define("BX_FILE_PERMISSIONS", 0666);
      define("BX_DIR_PERMISSIONS", 0777);

      However, you will have to manually set permissions for the files created via FTP or SFTP (or use the umask parameter if supported by the hosting provider).

    PHP settings

    Incorrect PHP settings can cause other issues, for example:

    • File owner mismatch: there are servers where PHP runs as one user, while FTP/SFTP access is granted on behalf of another user. As a result, files created by a PHP script would be unavailable via FTP and vice versa, or worse – the server would throw a runtime error due to security violation.
    • Security settings related issues. There are more than one way for PHP to connect to the server, and some of the methods impose strict restrictions on file owner and file permissions. This will result in error 500, and you will have to review web server logs to find the cause of the error.

      Example: most hosting services require that the file owner and file permissions match if PHP is configured as CGI. If the file owner is anything but your account or file permissions allow write access to anyone, PHP script will fail. In this case correct permissions for files and folders have to be assigned, and the dbconn.php file needs to have correct parameters.

    • • Maximum script execution time or other restrictions. If these are in place, the site may act weird: now it works, the next instant it doesn’t.

      Example: Data export and import scripts are ones of the most memory and time dependent. If you encounter issues, check resources on your server. If you find them restricted, contact the administration or change the hosting company altogether.

    • UTF-8 related issues. Make sure this universal encoding is supported (mbstring library is required; PHP parameter mbstring.func_overload=2 has to be set).
    • Other hosting specific issues. To avoid problems, we recommend that you test your site on the selected hosting provider before deploying the project.

    Possible issues with multisite configurations of Bitrix Framework

    Make sure your hosting provider will support your multisite strategy. Not all hosting companies provide correct environment to configure Bitrix Framework to support multiple sites.

    Email issues

    There are hosting companies that don't allow sending email without authentication. If this is the case, you will have to write a custom email sending function according to documentation.

    Site is unavailable after unpacking

    Sometimes, after the archive was unpacked, all a site can show to a user is the authentication form. There are several possible reasons for that:

    • The field Web server root directory for this site specifies incorrect value (Settings> System Settings> Websites > Websites сайтов).

      Solution: set the correct path in this field by clicking insert currently used path link. You can leave the field empty if all of your sites run on the same server.

    • • If you migrated the site by simply copying the files over FTP or SSH, the file .access.php might not be allowed to copy. This file contains user group permissions for the site; any such access will be denied if the file is missing>.

      Solution 1: create a new .access.php file in the site root and add the following text to it:

      <?  $PERM["/"]["*"]="R"; ?>

      or

      Solution 2: open the Site Explorer form in your site's Control Panel. Open the site root folder properties window, click the Access tab and set the All Users user group permission to Read.

    Incomplete archive

    Sometimes users notice that, if they open the site archive in WinRAR, there are a lot fewer files than on the source site.

    Reason: the tar format is rather fluid and varies. The system creates a GNU tar, archive, just like the tar command does in Linux. WinRar understands tar, in general, but does not provide full support for this dialect.

    You have to unpack the archive using the restore.php script available on the Backups page. However, if you notice some of the files are missing even then, you have to contact the Helpdesk.

    ERROR 1062 (23000)

    Sometimes users encounter this error when unpacking the archive: ERROR 1062 (23000) at line 1247: Duplicate entry '2-?' for key 2.

    Reason: archive encoding does not match target database server encoding.

    • Archive encoding is sourced from the file /bitrix/php_interface/after_connect.php, for example:
      <?
      $DB->Query("SET NAMES 'utf8'");
      ?>
      which here means the archive is created in UTF-8 encoding.
    • • To learn the target server's encoding, execute the following SQL query to get the value of character_set_server parameter:
      show variables where Variable_name = 'character_set_server';

    Solution 1:

    • Set the parameter character_set_server in the target server's database to the one specified on the source system (and therefore inherited by the archive).

      Attention! You may have to ask your hosting service administration to make this adjustment.

    .htaссess related errors

    Unexpected errors like a 404 when trying to view a details page are often due to the remote system incorrectly renaming the .htaссess file by adding an underscore ("_") to the filename. Find all files whose filename match .htaссess and correct the name if necessary.

    IIS related issues

    The system adds the web.config file to the archive, which may cause the restore.php script to malfunction.

    Solution: Delete the extracted web.config. The server will create a new one as required.


    Possible errors

    This section contains information about possible errors that can occur with server settings and databases during the product use.

    Server configuration errors

    Requisite access rights at server

    Access permissions configuration

    You (or your hosting service) can configure access permissions on the remote server as desired, but the result must be the only one: scripts should be able to access files for both reading and writing, which means that a primary "user" under which the Apache server runs, must be able to access files with these modes.

    At the same time, if a shared hosting is the case, other users must not be able to read or write your files via their scripts. Your "user" should be able to rewrite files via the FTP as well as modify uploaded files from within scripts.

    The problem is that each hosting provider has their own security policy and preferences.

    Some hosting providers launch the server process under user nobody:group by default. The files that a hosting client stores on a server, should be accessible by the Apache. It means that they has the attribute read for all set, or a user (file owner) and server must belong to the same group. In the latter case, files must be accessible by the group members for reading (FTP servers assign this kind of permission).

    This approach hits hard the security because if all users belong to the same group, they can read each other's files. Say, a user opened a page in the browser which runs a CGI script. As the script in fact is executed by the Apache server which runs under nobody, the script will run with permissions assigned to this user.

    The Bitrix24 remains fully functional with any access permission that you have specified at the installation time.

    To allow the Bitrix24 work correctly with your CHMOD, you have to set the following constants in /bitrix/php_interface/dbconn.php:

    define("BX_FILE_PERMISSIONS", 0644); 
    define("BX_DIR_PERMISSIONS", 0755);

    These are the standard settings of rights used on the majority of hosting types. Should any problems occur, please contact the support service of your hosting.

    You can set the access permission level manually by using CHMOD in console.

    The following command sets the access permission level for both files and folders:

    chmod -R 644 *

    You can use the following command to set rights for folders only:

    find . -type d -exec chmod 0755 {} ';'

    If you need to establish different rights on folders and files, please execute the following script:

    <?php 
    define("BX_FILE_PERMISSIONS", 0644); 
    define("BX_DIR_PERMISSIONS", 0755); 
    
    function chmod_R($path) { 
    
       $handle = opendir($path); 
       while ( false !== ($file = readdir($handle)) ) { 
         if ( ($file !== ".") && ($file !== "..") ) { 
           if ( is_file($path."/".$file) ) { 
             chmod($path . "/" . $file, BX_FILE_PERMISSIONS); 
           } 
           else { 
             chmod($path . "/" . $file, BX_DIR_PERMISSIONS); 
             chmod_R($path . "/" . $file); 
           } 
         } 
       } 
       closedir($handle); 
    } 
    
    $path=dirname(__FILE__); 
    umask(0); 
    chmod_R($path); 
    echo $path; 
    ?>
    

    Some FTP clients allows to recursively set rights for files and folders. For example: FlashFXP version 3.xx.

    Please pay attention to check the appropriate boxes:

    Separately set File and Folder attributes; 
    Apply changes to all subfolders and files

    Each instance has its own level:

     
    Folder permissions   File permissions

    Important: The Site Explorer allows to view the system-level attributes of files and folders.

    When viewing the file structure in the Site Explorer, the level of access rights to files and folders for each user group may be seen in the Access permissions column using the Extended button.

    Using .htaccess

    .htaccess htaccess (hypertext access) is a file of an additional configuration of the Apache web server. It permits you to set a large number of additional parameters and permissions for web server operation in a separate catalog without changing the main configuration file httpd.conf.

    The file .htaccess is similar to httpd.conf, the only difference is that it applies only to the catalog where it is located and to its child directories. The file .htaccess may be located in any catalog unless these directives are redefined by directives of underlying .htaccess files. Proper settings of the main configuration file httpd.conf are necessary for the .htaccess files to become usable (the value of the directive AllowOverride must be set as All). The paths to files and catalogu must be indicated from the server root.

    You do not need to restart server after you have modified the .htaccess file. This file is checked each time the server is queried, that’s why changes take into effect right away. As this is the system file, it cannot be accessed by users from their browser.

    Note: During installation, the processing of .htaccess files is verified in the preliminary check step.

    In the demonstration site, the file .htaccess contains the following directives by default:

    Options -Indexes 
    ErrorDocument 404 /404.php
    
    <IfModule mod_php5.c>
      php_flag allow_call_time_pass_reference 1
      php_flag session.use_trans_sid off
    
      #php_value display_errors 1
    
      #php_value mbstring.func_overload 2
      #php_value mbstring.internal_encoding UTF-8
    </IfModule>
    
    <IfModule mod_rewrite.c>
      Options +FollowSymLinks
      RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_FILENAME} [\xC2-\xDF][\x80-\xBF] [OR]
    RewriteCond %{REQUEST_FILENAME} \xE0[\xA0-\xBF][\x80-\xBF] [OR]
    RewriteCond %{REQUEST_FILENAME} [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} [OR]
    RewriteCond %{REQUEST_FILENAME} \xED[\x80-\x9F][\x80-\xBF] [OR]
    RewriteCond %{REQUEST_FILENAME} \xF0[\x90-\xBF][\x80-\xBF]{2} [OR]
    RewriteCond %{REQUEST_FILENAME} [\xF1-\xF3][\x80-\xBF]{3} [OR]
    RewriteCond %{REQUEST_FILENAME} \xF4[\x80-\x8F][\x80-\xBF]{2}
    RewriteCond %{REQUEST_FILENAME} !/bitrix/virtual_file_system.php$
    RewriteRule ^(.*)$ /bitrix/virtual_file_system.php [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-l
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
      RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
      RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
    </IfModule>
    
    <IfModule mod_dir.c>
      DirectoryIndex index.php index.html
    </IfModule>
    
    <IfModule mod_expires.c>
      ExpiresActive on
      ExpiresByType image/jpeg "access plus 3 day"
      ExpiresByType image/gif "access plus 3 day"
      ExpiresByType image/png "access plus 3 day"
      ExpiresByType text/css "access plus 3 day"
      ExpiresByType application/javascript "access plus 3 day"  
    </IfModule> 
    
    

    Note
    To activate the commented PHP directives, you have to remove the comment operator (#) at the beginning of each line. If your Apache server does not allow PHP flags, these directives will incur an internal server error (500). If this is the case, comment these directives back.
    Other uncommented PHP directives are enclosed in the verification condition statements ensuring the required Apace modules are present in the system. These directives will never cause the server errors.

    1. The PHP directive php_flag session.use_trans_sid off disables the session ID in the site URL's.
    2. If the PHP flag php_value display_errors is set to 1, the error messages are enabled and displayed. The directive php_value error_reporting defines which level of PHP interpreter errors is displayed.
    3. The directives php_value mbstring.func_overload 2 and php_value mbstring.internal_encoding UTF-8 control the settings of the mbstring library.
    4. The directive block IfModule mod_rewrite.c - is a setting of rights for mod_rewrite.
    5. The directive AddType application/x-httpd-php .ico determines the processing of the extension ico as php files.
    6. The directive ExpiresActive on enables image caching which boosts their download speed on the repeated queries.

      ExpiresByType image/jpeg "access plus 3 day" and ExpiresByType image/gif "access plus 3 day" define the cached image format and the caching period. By default, .jpeg and .gif files are cached for 3 days.
    Note: The file .htaccess must be saved in the UNIX format (Save as UNIX text option in the FAR manager editor).

    Authorization in the CGI Mode

    Sometimes authorization during data exchange with 1C will not work. The problem is often caused by php operating in the CGI mode. This mode experiences problems with HTTP data transmission to php. It can be verified by viewing phpinfo() in the section Server API: CGI.

    The problem may be bypassed, but .htaccess processing and mod_rewrite must be activated on the server. To activate them, please proceed as follows:

    • Add the following lines in the file .htaccess of the site root:
          RewriteEngine on
          RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
    • Comment out the following lines in the file bitrix/admin/.htaccess that deactivate mod_rewrite:
          #<ifmodule mod_rewrite.c="">
          # RewriteEngine Off
          #</ifmodule>
    • Add the following lines in the file bitrix/php_interface/dbconn.php:
          $remote_user = $_SERVER["REMOTE_USER"] 
          ? $_SERVER["REMOTE_USER"] : $_SERVER["REDIRECT_REMOTE_USER"];
          $strTmp = base64_decode(substr($remote_user,6));
          if ($strTmp)
              list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $strTmp);

    To check the operability of HTTP authorization, please use the script.

    Attention: sometimes this bypass option fails to solve the problem. If after all the recommendations are implemented HTTP authorization fails, please contact your hosting provider about this problem.

    Database failures

    Database connection errors

    When a database connection error occurs, the following error message is displayed:

    The visual aspect of the message is defined by the contents of the file /bitrix/php_interface/dbconn_error.php:

    <br>
    <table cellpadding="1" cellspacing="0" width="35%" bgcolor="#9C9A9C">
        <tr>
            <td>
            <table cellpadding="5" cellspacing="0" width="100%">
            <tr>
                <td bgcolor="#FFFFFF" align="center">
                <FONT face="Verdana, Arial, Helvetica, sans-serif" size="-1">
                <font color="#FF0000"><b><?echo "Error connecting to database."?></b></font><br>
                Please try again.</font></td>
            </tr>
            </table>
            </td>
    	</tr>
    </table>	
    <br><br><br>

    To resolve the problem, do the following:

    • check the database connection parameters (in /bitrix/php_interface/dbconn.php);
    • check whether the database is accessible.

    Database query errors

    When a database query error occurs, the following error message is displayed:

    The visual aspect of the message is defined by the contents of the file /bitrix/php_interface/dbquery_error.php.

    Situations may happen when a site denies to reply and returns an empty page to visitors. In this case, open the file bitrix/php_interface/dbconn.php containing the database connection parameters, and set the parameter: $DBDebug = true;

    <?
    define("DBPersistent", true);
    $DBType = "mysql";
    $DBHost = "localhost:31006";
    $DBLogin = "root";
    $DBPassword = "";
    $DBName = "bsm_demo";
    $DBDebug = true;
    $DBDebugToFile = false;
    
    set_time_limit(60);
    
    define("BX_FILE_PERMISSIONS", 0644);
    define("BX_DIR_PERMISSIONS", 0755);
    @ini_set("memory_limit", "64M");
    ?>

    This will cause the error message to be printed. The message usually contains names of damaged tables.

    Run perror.exe (can be found in mysql/bin) with the error code to get the error description:

    Note: The error 28 displays the following description:

    This means that the disk on which the database is installed is out of free space.

    If the database damage is the case, you are recommended to use the built-in database check and repair tool. This will allow you to restore the site functionality in the shortest possible time.

    Note!
    • The standard database check and repair tool only works with the MyISAM tables of MySQL.
    • The check script starts from the administrative section of the site Settings > Tools > System Administration > Database Check:

      If the statistics tables are damaged and you cannot open the Control Panel, you can disable gathering statistics by supplying the parameter ?no_keep_statistic_LICENSE-KEY=Y on the URL (substitute LICENSE-KEY with your license key).

    • There is a possibility to use the check script and recover the database without the need to go to the administrative section.

      To do so, supply the database access login and password on the URL. For example: http://www.mysite.com/bitrix/admin/repair_db.php?login=DB_Login&password=DB_Password. By default, the database access parameters are stored in /bitrix/php_interface/dbconn.php.

    Problem:

    The following error appears on the screen:

    MySQL Query Error: ….. [Out of memory restart server and try again (needed 65528 bytes)]

    Solution:

    Memory size must be increased in MySQL settings.

    The following MySQL parameters should be used and entered in the MySQL configuration file my.cnf:

    key_buffer = 128K
    max_allowed_packet = 16M
    table_cache = 4
    sort_buffer_size = 128K
    read_buffer_size = 128K
    read_rnd_buffer_size = 128K
    net_buffer_length = 128K
    thread_stack = 128K
    

    MySQL will have to be reloaded after you change the parameters.

    Possible server failures

    500 - Internal Server Error

    Error.log

    Since there are a lot of reasons which may cause server errors, their diagnostics is very complex and tedious.

    If a server error occurs, the first thing to do is view the error.log file. This file may contain a line with the error description.

    • Typical situation when a server error may occur is exceeding the allowed server permissions.

      For example: the system creates and saves a page with the 0777 permissions, while the maximum permission allowed by the server is 0644. The server will return the 500 error upon attempt to access the page.
    • A timeout limit for the execution of php scripts may also be a possible cause;
    • Alternatively, the system may have no write or read rights, etc.
    • Another prevailing reason is invalid server configuration or using forbidden directives (for example, in .htaccess). In this case, remove or comment the failure line in the file.
    • Note! If PHP runs as CGI, the 500 error may be cause by a PHP fatal error. In this case, you are recommended to check the program code and diagnose the error.
    • Internal server errors may come about when a CGI script runs on the Apache server and the execution time exceeds the maximum allowed period specified in the server configuration.

    Thus, everything depends on the server configuration.

    It is important to know that the said restrictions are not determined through PHP settings in php.ini.

    Normally, such an error and its cause are recorded in server logs. You have to refer to the hoster requiring that the reason of the error be indicated and the error be eliminated (for example, by increasing the resources). If the hoster could not find a solution, please contact Bitrix helpdesk providing an accurate description of the error and the reasons indicated by the hoster. Helpdesk will not be able to assist you without knowing the reason of the error.

    Document Search Setup

    By default, the product supports MS Office 2007 document search. In order to search all the documents, a number of settings described in this chapter must be made.

    Adding new formats

    By default, Bitrix24 uses the search feature in standard MS Office documents. If it is required to organize a search in documents of other formats, the format list shall be extended and necessary file processing programs shall be connected.

    • Download the necessary programs for converting text information contained in these documents to the plain text mode.
    • Having installed this program on the computer with Bitrix24, open the Intranet module setting page in the administrative section (Settings > System settings > Module settings > Intranet). Go to the Search tab..

    • Enter the required format, e.g., odt in the empty line in the Extension column.
    • In the External command column, enter the command in the format: . The program itself must be able to display data in UTF-8.

      E.g., the external command for the Otf2txt program for the conversion of a document made in the .ODT (OpenOffice) format to the .TXT format is as follows: odt2txt --encoding=UTF-8 #FILE_NAME#:

    • In the column Converter Directory please indicate the path to the catalog with the installed program and save the changes made.
    • In order to enable search in the new format, *.odt must be added in the Include file types box on the Search module setting page (Settings > System settings > Module settings > Search):

    Note: when working with PDF files, some Russian language files may be indexed improperly. In this case, replace the package XPDF by The Poppler Developers (included in the installation package) to the package Poppler-Utils by the Glyph and Cog.

    Setting Up Web Environment with PHP Version below 5.2.6

    If you installed Bitrix24 on Bitrix Web Environment 1.х with a version of PHP earlier than 5.2.6, an error might occur due to the absence of the library php_zip.dll in these installation packages. In this case, the following message appears:

    Attention: The zip_open function is not found. It is possible that the zip extension has not been loaded.

    This error indicates that the system will not index files of MS Office 2007 or OpenOffice.

    Note: In Bitrix Web Environment version 2.0 the library php_zip.dll is already enabled.

    In order to eliminate the error, please proceed as follows:

    • Download the library php_zip.dll from the Internet.
    • Place it into the folder X:\<path_to_folder>\Bitrix Environment\apache\extensions, where X:\<path_to_folder> - is a path to the folder where Bitrix Web Environment is installed.
    • Open the file X:\<path_to_folder>\Bitrix Environment\apache\php.ini.nooci for editing.

      In the section Dynamic Extensions of this file, add the line extension=php_zip.dll in the general list of all extensions. Save the changes made.
    • Restart Bitrix Web Environment. The error will be eliminated.

    Search of MS Office documents of earlier versions

    Search of the documents created in earlier versions of MS Office (before MS Office 2007) (doc, xls, and ppt formats) is possible using Catdoc – a special program package for the conversion of documents into plain text format.

    If Bitrix24 is installed in the Bitrix Web Environment, starting from version 1.1, you already have the Catdoc package installed and enabled.

    Checking for Catdoc Installation

    You may check the availability of the Catdoc package as follows:

    Go to Start > Run. In a opened window, type cmd. Click ОK. Command prompt window opens.

    • If you check the availability of the packet in Bitrix: Web Environment 1.1, type the command CD <full_path_to_environment_folder>\catdoc and press enter. Next, type env.exe HOME=. catdoc.exe -v.

      Note: In Bitrix. Web Environment 2.0 the Catdoc package is already installed in the folder <full_path_to_environment_folder >\catdoc\.

    • If you check the availability of the Catdoc package on the computer, enter the assumed <full_path_to_package_folder>\catdoc.exe -v.

    Press enter. The system must display a message similar to this:

    Usage:

    catdoc [-vu8btawxlV] [-m number] [-s charset] [-d charset] [ -f format] files

    If the message is as follows:

    "C:\..." is not an internal or external command run by a program or a package file.

    then either the specified path is incorrect or Catdoc is not installed.

    Note: the path to the package must be specified in the settings of the Intranet module in the Search tab (Settings > System settings > Module settings > Intranet).

    Installation of the Catdoc Package

    If the Catdoc program package is not installed due to any reasons, please follow the following steps:

    • Open the site http://www.cygwin.com/ in browser and download the file setup.exe of the Cygwin.
    • Start up the program installation and follow the instructions of the Installation Wizard..
    • At the step of selecting packages for installation, open the Text package group and mark the package Catdoc for installation:

    • Complete the installation according to the instructions of the Installation Wizard.
    • In the administrative section of the product, please open the settings page of the Intranet module (Settings > System settings > Module settings > Intranet) and go to the Search tab. Change paths to *.exe files according to their location chosen during the installation of Cygwin: