{"id":89477,"date":"2020-07-23T01:42:18","date_gmt":"2020-07-22T23:42:18","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast"},"modified":"2020-07-23T01:42:18","modified_gmt":"2020-07-22T23:42:18","slug":"apache-nginx-svyazany-odnoj-czepyu-2-chast","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast","title":{"rendered":"Apache &amp; Nginx. Connected by a chain (Part 2)","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Last week in <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/510896\/\">the first part<\/a><\/noindex> this article, we described how the combination of Apache and Nginx is structured in Timeweb. We are very grateful to our readers for their questions and active discussion! Today, we're explaining how to implement multiple PHP versions on a single server and why we guarantee data security for our clients.<\/p>\n<p><img decoding=\"async\" alt=\"Apache &amp; Nginx. Linked in a chain (Part 2)\" src=\"\/wp-content\/uploads\/2020\/07\/54ee6b96e48cd1ce8fe8d93d36301202.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<b>Virtual hosting<\/b> (Shared hosting) implies that multiple client accounts are hosted on a single server. One client's account typically has several websites. These websites operate on both ready-made CMS (like Bitrix) and custom ones. Thus, the technical requirements for all systems differ, so it is necessary to manage multiple PHP versions within a single server. <br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nWe use Nginx as the main web server: it handles all incoming connections and serves static content. Other requests are proxied to the Apache web server. This is where the magic begins: a separate instance of Apache is launched for each PHP version, listening on a specific port. This port is specified in the virtual host configuration for the client's site. <\/p>\n<p>You can read more about the operation of the Shared scheme in <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/510896\/\">the first part of the article<\/a><\/noindex>.<\/p>\n<p><img decoding=\"async\" alt=\"Apache &amp; Nginx. Linked in a chain (Part 2)\" src=\"\/wp-content\/uploads\/2020\/07\/954199b375199d847a55729491df6610.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Shared scheme <\/i><\/p>\n<p>It's important to note that we install PHP packages for different versions because usually all distributions contain only one PHP version. <\/p>\n<h4>Safety first!<\/h4>\n<p>\nOne of the main objectives of virtual hosting is to ensure the security of client data. Various accounts, while on the same server, are independent. How does this work?<\/p>\n<p>Website files are stored in the users' home directories, and the necessary paths are specified in the virtual host configurations of the web servers. It is crucial that the web servers, Nginx and Apache, have access to the final files of a specific client since the web server runs only under one user. <\/p>\n<p>For Nginx, a security patch developed by the Timeweb team is used: this patch changes the user to the one specified in the web server's configuration file. <\/p>\n<p>Other hosting providers may solve this issue, for instance, through manipulation with extended filesystem rights (ACL).<\/p>\n<p>Apache operates using a multiprocess module <noindex><a rel=\"nofollow\" href=\"http:\/\/mpm-itk.sesse.net\/\">mpm-itk<\/a><\/noindex>. It allows each VirtualHost to run with its own user identifier and group ID. <br \/>\n<img decoding=\"async\" alt=\"Apache &amp; Nginx. Linked in a chain (Part 2)\" src=\"\/wp-content\/uploads\/2020\/07\/9a635bb83c5f0e457027e03f06dcb623.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nThus, thanks to the operations described above, we create a secure, isolated environment for each client. At the same time, we also address the scalability challenges for Shared hosting. <\/p>\n<p>You can read about how the combination of Apache and Nginx is implemented in <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/510896\/\">the first part<\/a><\/noindex> our article. Additionally, an alternative configuration via the Dedicated scheme is also described there.<\/p>\n<p>If you have any questions for our experts, feel free to leave a comment. We will do our best to respond to everything or provide a more detailed solution in upcoming articles.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/511852\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 Apache \u0438 Nginx \u0432 Timeweb. \u041c\u044b \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u0437\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 PHP \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0448\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 (Shared-\u0445\u043e\u0441\u0442\u0438\u043d\u0433) \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043e [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":89478,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-89477","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 Apache \u0438 Nginx \u0432 Timeweb.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Apache &amp; Nginx. \u0421\u0432\u044f\u0437\u0430\u043d\u044b \u043e\u0434\u043d\u043e\u0439 \u0446\u0435\u043f\u044c\u044e (2 \u0447\u0430\u0441\u0442\u044c) | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 Apache \u0438 Nginx \u0432 Timeweb.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-07-22T23:42:18+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-22T23:42:18+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Apache &amp; Nginx. Linked in a chain (Part 2) | ProHoster","description":"Last week in the first part of this article, we described how the combination of Apache and Nginx is built in Timeweb.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Apache &amp; Nginx. \u0421\u0432\u044f\u0437\u0430\u043d\u044b \u043e\u0434\u043d\u043e\u0439 \u0446\u0435\u043f\u044c\u044e (2 \u0447\u0430\u0441\u0442\u044c) | ProHoster","og:description":"\u041d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 Apache \u0438 Nginx \u0432 Timeweb.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/apache-nginx-svyazany-odnoj-czepyu-2-chast","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-07-22T23:42:18+00:00","article:modified_time":"2020-07-22T23:42:18+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"89477","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 13:11:26","updated":"2022-10-05 03:45:26","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/89477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=89477"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/89477\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/89478"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=89477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=89477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=89477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}