T
The multi-site version of the product can be implemented in two configuration modes:A lot of websites on the same house. (Star name: Multiple websites in Mode 1.) Products and all sites are managed by one copy of the Apache web server. A lot of websites on different domains. (Star name: Multiple Websites in Mode 2.) Each site is managed by a separate copy of the Apache web server or a separate virtual web server.
Web configurationMultiple sites on one houseThe fundamental need for multiple web sites on one house is to separate subcategories so that the structure of the files does not cross. Each site should be located in a separate subcategory inside the original catalogue.It is possible, however, to create an equivalent folder in the structure of the root catalogue and to create a folder of the second site inside the director of the first site. So the combinations are allowed as a species:/www/s1/ - первый сайт,
/www/s2/ - второй сайт.
And the combination of the species:/www/s1/ - первый сайт,
/www/s1/s2 – второй сайт.
When we build multiple web sites on one house, we have one Apache web server, the DocumentRoot, who is on the catalogue /home/www/allsites.Set a programme product of " 1C-Bitrix: Web site management in this catalogue.Each site in the first mode of configuration should be located in a separate subcategory within a single catalogue, for example:/home/www/allsites/s1/
/home/www/allsites/s2/
Catalogue names s1, s2 can be chosen by any, for example, shop and company, or en and de respectively. It is possible that one site is located in the original catalogue (e.g. /home/www/allsites/) and a second site in the subcategory (e.g. /home/www/allsites/s2/).The site development is carried out in the administrative section of the system (Installation of the Contemporary Constabulary of Product Circuit Circular of websites).Choose "Replace" the parameters of website No. 1 and indicate in them:Название: site1
Доменное имя: оставить пустым
Папка сайта: /s1/
Название сайта: Корпоративный сайт компании "Название компании"
URL сервера:www.site1.com/s1
Путь к корневой папке веб-сервера для этого сайта: оставить пустым
The Papple of the site should indicate the way to the root of the catalogue where the public part of the site is located. And the route to the root folder of the web server for this site is not used in this way to build many sites and should be empty for all sites.Similar to site No. 2:Название: site2
Доменное имя: оставить пустым
Папка сайта: /s2/
Название сайта: Интернет-магазин компании "Название компании"
URL сервера:www.site1.com/s2
Путь к корневой папке веб-сервера для этого сайта: оставить пустым
Multiple domainsWe will need to build a software product to operate multiple sites on different domains. Apache ' s web server, as in the case of multiple web sites on one house, should be built by a hosting company.We'll use the two-site configuration:www.site1.com - корпоративный сайт компании
www.site2.com - интернет-магазин компании
Each site should be located in the relevant catalogue, for example:/home/www/site1/
/home/www/site2/
The product is installed in one of the sites. To enable the core to operate for both sites, there is a need to create symbolic links for a site that does not have a designated nucleus. References will be required for /bitrix, /local and /upload. These folders are common to both sites, that is the feature of the architecture.References can be made in two ways. The first is a classic one recommended by the company from the start. The second one is later, it's considered more "paint and fine." It does not take a step to create a separate folder and transfer the system nucleus.First option:Set the program product "1C-Bitrix: Web site management."
First on site catalogue /home/www/site1/Make a catalogue. /home/www/shared/in which
common files for all sites:mkdir /home/www/sharedRemove the entire catalogue. /home/www/site1/bitrix/ Total
/home/www/shared/bitrix/:mv /home/www/site1/bitrix /home/www/shared/bitrixRemove the entire catalogue. /home/www/site1/upload/ Total
/home/www/shared/upload/:mv /home/www/site1/upload /home/www/shared/uploadRemove the entire catalogue. /home/www/site1/local/ Total
/home/www/shared/local/:mv /home/www/site1/local /home/www/shared/localCreate a symbolic link for the catalogue /bitrix/in each
websites:ln -s /home/www/shared/bitrix /home/www/site1/
ln -s /home/www/shared/upload /home/www/site1/
ln -s /home/www/shared/local /home/www/site1/
ln -s /home/www/shared/bitrix /home/www/site2/
ln -s /home/www/shared/upload /home/www/site2/
ln -s /home/www/shared/local /home/www/site2/
Make sure the web server has the right to record.
catalogue /home/www/shared/
updates and downloads of graphical files)Put the public part of the second site in the catalogue. /home/www/site2/In building a multi-site configuration on UNIX, a symbolic reference software can be used:<?
symlink("/virt/homes/forinsured/bitrix", "/virt/homes/forinsured/htdocs/bitrix");
symlink("/virt/homes/forinsured/upload", "/virt/homes/forinsured/htdocs/upload");
symlink("/virt/homes/forinsured/local", "/virt/homes/forinsured/htdocs/local");
?>
Second option. It contains symbolic references directly in the folder of the second site.Set the programme product " 1C-Bitrix: Web site management " first to the first site catalogue /home/www/site1/Set up in the root folder of the second site./home/www/site2/() Scream, for example, by name symlink.php:<html>
<head><title>Создание ссылок на папки bitrix, local и upload</title></head>
<body>
<?
error_reporting(E_ALL & ~E_NOTICE);
@ini_set("display_errors",1);
if ($_POST['path'])
$path = rtrim($_POST['path'],"/\");
else
$path = '../site1/www';
if ($_POST['create'])
{
if (preg_match("#^/#",$path))
$full_path = $path;
else
$full_path = realpath($_SERVER['DOCUMENT_ROOT'].'/'.$path);
if (file_exists($_SERVER['DOCUMENT_ROOT']."/bitrix"))
$strError = "В текущей папке уже существует папка bitrix";
elseif (is_dir($full_path))
{
if (is_dir($full_path."/bitrix"))
{
if (symlink($path."/bitrix",$_SERVER['DOCUMENT_ROOT']."/bitrix"))
{
if (symlink($path."/upload",$_SERVER['DOCUMENT_ROOT']."/upload"))
{
if (symlink($path."/local",$_SERVER['DOCUMENT_ROOT']."/local"))
echo "Символические ссылки удачно созданы";
else
$strError = 'Не удалось создать ссылку на папку local, обратитесь к администратору сервера';
}
else
$strError = 'Не удалось создать ссылку на папку upload, обратитесь к администратору сервера';
}
else
$strError = 'Не удалось создать ссылку на папку bitrix, обратитесь к администратору сервера';
}
else
$strError = 'Указанный путь не содержит папку bitrix';
}
else
$strError = 'Неверно указан путь или ошибка прав доступа';
if ($strError)
echo ''.$strError.'
Исходный путь: '.$full_path;
}
?>
<form method=post>
Путь к папке, содержащей папки bitrix, local и upload: <input name=path value="<?=htmlspecialchars($path)?>"><br>
<input type=submit value='Создать' name=create>
</form>
</body>
</html>Start the violin and point the way to the root folder of the first site, in our case /home/www/site1/♪After symbolic references are made, put a browser in the address line site1/bitrix/admin♪ There'll be a copying panel.Introduce the data of the administrator that was indicated when the product was installed on the first site and enter the administrative panel of C-Bitrix: Web site management.After completion of the crypt, there are symbolic references to folders /bitrix, /local и /upload In the folder of the second site, one-name files can be checked.The site development is carried out in the administrative section of the system on the site page of the Constabulary of the Constabulary of Product Circuit List.In the line of the first site (www.site1.com), in the action column, the team is selected to change and indicate:Название: site1
Доменное имя:site1.com
Папка сайта: /
Название сайта: Корпоративный сайт компании "Название компании"
URL сервера: www.site1.com
Путь к корневой папке веб-сервера для этого сайта: /home/www/site1/
If the DNS is so arranged that your website responds to the address. http://site1.com , in the field, the Dominic name is desirable without www. You can list in this field with a new line any number of domain names that you want to answer the site (or answer already).It is important to bear in mind that the values given in the domain of the Home Name are used by the product to disseminate information on visitors ' transport technology to the designated domains. It is therefore highly desirable to indicate a complete list of housewives on which the site can respond.It is important not to indicate on the list of domains that do not work on this product. The incorrect or non-existent dominance may not only slow the user ' s work, but will not in fact permit the transfer of data to sites that do not operate on a common product.Similar to the second site (www.site2.com/):Название: site2
Доменное имя: site2.com
Папка сайта: /
Название сайта: Интернет-магазин компании "Название компании"
URL сервера: www.site2.com
Путь к корневой папке веб-сервера для этого сайта: /home/www/site2/
Please note that for the two sites on the Pappa website, the same meaning is given: "/." This is because websites are serviced by different virtual servers (in Apache terminology) that have different catalogues used to house files.Attention should also be drawn to the pitch to the root folder of the web server for this site. For different sites, it has its value taken from the documentRoot on the building of an appropriate virtual server (see below for the example of a portion of the file httpd.conf on the Apache constructions).Bitrix has one. https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=103&CHAPTER_ID=03987&LESSON_PATH=8799.3987 On multi-site work, which describes key work and development scenarios. Read, choose the right option and build.