{"id":30053,"date":"2019-10-31T21:33:26","date_gmt":"2019-10-31T18:33:26","guid":{"rendered":"https:\/\/prohoster.info\/blog\/optimizatsiya-proizvoditelnosti-apache2\/"},"modified":"2019-10-31T21:33:26","modified_gmt":"2019-10-31T18:33:26","slug":"optimizatsiya-proizvoditelnosti-apache2","status":"publish","type":"post","link":"https:\/\/prohoster.info\/hu\/blog\/optimizatsiya-proizvoditelnosti-apache2","title":{"rendered":"Apache2 teljes\u00edtm\u00e9nyoptimaliz\u00e1l\u00e1sa","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Sokan apache2-t haszn\u00e1lnak webszerverk\u00e9nt. Azonban kevesen gondolkodnak a teljes\u00edtm\u00e9ny optimaliz\u00e1l\u00e1s\u00e1n, ami k\u00f6zvetlen hat\u00e1ssal van a weboldalak bet\u00f6lt\u00e9si sebess\u00e9g\u00e9re, a szkriptek (k\u00fcl\u00f6n\u00f6sen a PHP) feldolgoz\u00e1si sebess\u00e9g\u00e9re, valamint a CPU leterhelts\u00e9g\u00e9re \u00e9s az el\u00e9rhet\u0151 RAM mennyis\u00e9g\u00e9re. <\/p>\n<p>Ez\u00e9rt a k\u00f6vetkez\u0151 \u00fatmutat\u00f3nak seg\u00edtenie kell a kezd\u0151 (\u00e9s nem csak) felhaszn\u00e1l\u00f3kat.<br \/>\nAz al\u00e1bbi p\u00e9ld\u00e1k Raspberry PI 3-on, Debian 9-en, Apache 2.4.38-on \u00e9s PHP 7.3-on k\u00e9sz\u00fcltek.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nEzt teh\u00e1t kezdj\u00fck el.<\/p>\n<h3>1. Nem haszn\u00e1lt modulok letilt\u00e1sa<\/h3>\n<p>\nAz els\u0151 m\u00f3dszer a nem haszn\u00e1lt modulok ban\u00e1lis letilt\u00e1sa:<\/p>\n<p>A jelenleg haszn\u00e1lt modulok list\u00e1j\u00e1t az al\u00e1bbi paranccsal tekintheti meg:<\/p>\n<pre><code class=\"bash\">apache2ctl -M<\/code><\/pre>\n<p>\nA modul letilt\u00e1s\u00e1hoz az al\u00e1bbi parancsot haszn\u00e1ljuk:<\/p>\n<pre><code class=\"bash\">a2dismod *modul neve*<\/code><\/pre>\n<p>\nA modul enged\u00e9lyez\u00e9s\u00e9hez az al\u00e1bbi parancsot haszn\u00e1ljuk:<\/p>\n<pre><code class=\"bash\">a2enmod *modul neve*<\/code><\/pre>\n<p>\nK\u00e9rj\u00fck, vegye figyelembe, hogy az <i>a2dismod<\/i>parancs haszn\u00e1latakor a modul nev\u00e9t \u00f6n\u00e1ll\u00f3an kell megadni, an\u00e9lk\u00fcl, hogy a 'modul' sz\u00f3t haszn\u00e1ln\u00e1nk.<\/p>\n<p>P\u00e9ld\u00e1ul, ha a parancs kimenet\u00e9ben a <i>apache2ctl -M<\/i> proxy_module <i>sz\u00f3t l\u00e1tta, akkor annak letilt\u00e1s\u00e1hoz az al\u00e1bbi parancsot kell haszn\u00e1lni:<\/i>a2dismod proxy <i>A legjobban leterhel\u0151 modulok (saj\u00e1t tapasztalat alapj\u00e1n) a k\u00f6vetkez\u0151k:<\/i><\/p>\n<p>PHP, Ruby, Perl \u00e9s egy\u00e9b modulok k\u00fcl\u00f6nb\u00f6z\u0151 szkriptnyelvekhez<\/p>\n<ul>\n<li>Rewrite<\/li>\n<li><a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/hu\/ssl-sertifikat\/\"   title=\"SSL\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"2258\">SSL<\/a><\/li>\n<li>CGI<\/li>\n<li>Teh\u00e1t azokban az esetekben, amikor ezek a modulok nem sz\u00fcks\u00e9gesek, aj\u00e1nlom, hogy tiltsa le \u0151ket.<\/li>\n<\/ul>\n<p>\nEzenk\u00edv\u00fcl, miut\u00e1n b\u00e1rmelyik modult letiltottuk, aj\u00e1nlom, hogy haszn\u00e1lja a k\u00f6vetkez\u0151 parancsot:<\/p>\n<p>apache2ctl configtest <i>, amely ellen\u0151rzi a haszn\u00e1lt webhelyek konfigur\u00e1ci\u00f3j\u00e1t, \u00e9s ha b\u00e1rmelyik letiltott modul sz\u00fcks\u00e9ges volt sz\u00e1mukra, hib\u00e1t jelez.<\/i>2. MPM (Multi-Processing Module) v\u00e1lt\u00e1s \u00e9s php-fpm haszn\u00e1lat<\/p>\n<h3>Alap\u00e9rtelmez\u00e9s szerint, telep\u00edt\u00e9s ut\u00e1n, az apache2 MPM Prefork-ot haszn\u00e1lja (1 sz\u00e1l 1 kapcsolat\u00e9rt), ami jelent\u0151sen cs\u00f6kkenti a teljes\u00edtm\u00e9nyt, de jav\u00edtja a stabilit\u00e1st \u00e9s a biztons\u00e1got.<\/h3>\n<p>\nAzonban a teljes\u00edtm\u00e9ny optimaliz\u00e1l\u00e1sa \u00e9rdek\u00e9ben javaslom az MPM Worker haszn\u00e1lat\u00e1t, amely lehet\u0151v\u00e9 teszi, hogy egyszerre t\u00f6bb sz\u00e1lat haszn\u00e1ljon egy kapcsolatra.<\/p>\n<p>Ennek enged\u00e9lyez\u00e9s\u00e9hez az al\u00e1bbi parancsokat haszn\u00e1ljuk:<\/p>\n<p>a2dismod mpm_prefork  \\\/\\\/ Felf\u00fcggesztj\u00fck a prefork-ot\na2dismod php7.3  \\\/\\\/ Felf\u00fcggesztj\u00fck a prefork-t\u00f3l f\u00fcgg\u0151 PHP modult\na2enmod mpm_worker  \\\/\\\/ Enged\u00e9lyezz\u00fck a workert<\/p>\n<pre><code class=\"bash\">Azonban a Worker haszn\u00e1lata sor\u00e1n el\u0151fordulhat, hogy probl\u00e9m\u00e1val szembes\u00fcl, mivel a php7.3 modul a Prefork modult\u00f3l f\u00fcgg.\n<\/code><\/pre>\n<p>\nA Worker haszn\u00e1lata sor\u00e1n azonban probl\u00e9m\u00e1val szembes\u00fclhet, mivel a php7.3 modul a Prefork modult\u00f3l f\u00fcgg.<\/p>\n<p>A probl\u00e9ma megold\u00e1s\u00e1hoz telep\u00edtj\u00fck a php7.3-fpm modult, amelyet a php-szkriptek v\u00e9grehajt\u00e1s\u00e1hoz fogunk haszn\u00e1lni:<\/p>\n<pre><code class=\"bash\">apt-get update &amp;&amp; apt-get install php7.3-fpm  \/\/ Telep\u00edtj\u00fck\nsystemctl enable php7.3-fpm &amp;&amp; systemctl start php7.3-fpm  \/\/ Aut\u00f3ind\u00edt\u00e1sra \u00e1ll\u00edtjuk \u00e9s elind\u00edtjuk\na2enmod php7.3-fpm &amp;&amp; a2enconf php7.3-fpm.conf  \/\/ A modult \u00e9s a konfigur\u00e1ci\u00f3t aktiv\u00e1ljuk\n<\/code><\/pre>\n<p>\n\u00c9rdemes megeml\u00edteni, hogy a php-fpm haszn\u00e1lata cs\u00f6kkenti az apache2 \u00e1ltal haszn\u00e1lt mem\u00f3ria mennyis\u00e9g\u00e9t, \u00e9s valamivel felgyors\u00edtja a php-szkriptek v\u00e9grehajt\u00e1s\u00e1t.<\/p>\n<h3>3. K\u00f6vetkeztet\u00e9s<\/h3>\n<p>\n\u00cdgy ezzel az egyszer\u0171 l\u00e9p\u00e9sekkel siker\u00fclt optimaliz\u00e1lnunk a teljes\u00edtm\u00e9nyt \u00e9s cs\u00f6kkenteni a terhel\u00e9st a g\u00e9pen (jelen esetben RPI3).<\/p>\n<p>Term\u00e9szetesen sok m\u00e1s optimaliz\u00e1ci\u00f3s lehet\u0151s\u00e9g is l\u00e9tezik, p\u00e9ld\u00e1ul a t\u00f6m\u00f6r\u00edt\u00e9s enged\u00e9lyez\u00e9se (amely val\u00f3ban hasznos, de a legt\u00f6bb esetben m\u00e1r alap\u00e9rtelmez\u00e9s szerint be van kapcsolva), a MPM konfigur\u00e1ci\u00f3s f\u00e1jlainak param\u00e9tereinek m\u00f3dos\u00edt\u00e1sa, a HostnameLookups letilt\u00e1sa stb., de ebben a cikkben igyekeztem hangs\u00falyozni azokat a pontokat, amelyek a legnagyobb seg\u00edts\u00e9get ny\u00fajtott\u00e1k sz\u00e1momra, \u00e9s rem\u00e9lem, hogy m\u00e1soknak is hasznosak lesznek.<br \/>\n<br \/>Forr\u00e1s: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/444732\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 apache2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0441\u0430\u0439\u0442\u0430, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 php), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u0440\u043e\u0441\u0442\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0426\u041f \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0451\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u041e\u0417\u0423. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u043d\u0443\u0430\u043b, \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c. \u0412\u0441\u0435 \u043d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-30053","post","type-post","status-publish","format-standard","hentry","category-blog"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 apache2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.\" \/>\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\/hu\/blog\/optimizatsiya-proizvoditelnosti-apache2\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"hu_HU\" \/>\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\udd47\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 apache2 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 apache2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/hu\/blog\/optimizatsiya-proizvoditelnosti-apache2\" \/>\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=\"2019-10-31T18:33:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:33:26+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\udd47Apache2 teljes\u00edtm\u00e9nyoptimaliz\u00e1l\u00e1s | ProHoster","description":"Sokan az apache2-t haszn\u00e1lj\u00e1k webszerverk\u00e9nt.","canonical_url":"https:\/\/prohoster.info\/hu\/blog\/optimizatsiya-proizvoditelnosti-apache2","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"hu_HU","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\udd47\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 apache2 | ProHoster","og:description":"\u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 apache2 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.","og:url":"https:\/\/prohoster.info\/hu\/blog\/optimizatsiya-proizvoditelnosti-apache2","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":"2019-10-31T18:33:26+00:00","article:modified_time":"2019-10-31T18:33:26+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"30053","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":"Article","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":"2026-02-09 17:29:02","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:43:14","updated":"2026-02-09 17:29:02","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts\/30053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/comments?post=30053"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts\/30053\/revisions"}],"predecessor-version":[{"id":159502,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/posts\/30053\/revisions\/159502"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/media?parent=30053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/categories?post=30053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/hu\/wp-json\/wp\/v2\/tags?post=30053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}