{"id":5705,"date":"2025-11-25T11:00:33","date_gmt":"2025-11-25T07:30:33","guid":{"rendered":"https:\/\/parmin.cloud\/blog\/?p=5705"},"modified":"2025-11-25T11:52:51","modified_gmt":"2025-11-25T08:22:51","slug":"%d9%be%d8%b3%d8%aa-%d8%ac%d8%af%db%8c%d8%af-4","status":"publish","type":"post","link":"https:\/\/parmin.cloud\/blog\/%d9%be%d8%b3%d8%aa-%d8%ac%d8%af%db%8c%d8%af-4\/","title":{"rendered":"\u0686\u06af\u0648\u0646\u0647 \u0644\u0627\u06af\u200c\u06af\u0630\u0627\u0631\u06cc HAProxy \u0631\u0627 \u0628\u0627 Rsyslog \u062f\u0631 Rocky Linux 8 \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u06a9\u0646\u06cc\u0645 [\u0631\u0627\u0647\u0646\u0645\u0627\u06cc \u0633\u0631\u06cc\u0639]\u061f"},"content":{"rendered":"<p>HAProxy \u06a9\u0647 \u0645\u062e\u0641\u0641 High Availability Proxy \u0627\u0633\u062a\u060c \u06cc\u06a9 \u0633\u0631\u0648\u0631 \u067e\u0631\u0627\u06a9\u0633\u06cc \u0645\u0628\u062a\u0646\u06cc \u0628\u0631 TCP \u0648 HTTP \u0627\u0633\u062a \u06a9\u0647 \u0631\u0648\u06cc \u0644\u06cc\u0646\u0648\u06a9\u0633\u060c \u0633\u0648\u0644\u0627\u0631\u06cc\u0633 \u0648 FreeBSD \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0628\u0631\u0627\u06cc \u0645\u062a\u0639\u0627\u062f\u0644\u200c\u0633\u0627\u0632\u06cc \u0628\u0627\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627 \u0628\u0647 \u06a9\u0627\u0631 \u0645\u06cc\u200c\u0631\u0648\u062f \u062a\u0627 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627 \u0628\u06cc\u0646 \u0686\u0646\u062f \u0633\u0631\u0648\u0631 \u062a\u0648\u0632\u06cc\u0639 \u0634\u0648\u0646\u062f \u0648 \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062d\u0627\u0635\u0644 \u0634\u0648\u062f \u06a9\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627 \u0647\u0645\u06cc\u0634\u0647 \u0628\u0631\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0647\u0633\u062a\u0646\u062f.<\/p>\n<p>\u0628\u0647 \u0637\u0648\u0631 \u067e\u06cc\u0634\u200c\u0641\u0631\u0636\u060c \u062f\u0631 \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u0646\u0635\u0628\u200c\u0647\u0627\u06cc Rocky Linux 8\u060c HAProxy \u0628\u0631\u0627\u06cc \u0646\u0648\u0634\u062a\u0646 \u0644\u0627\u06af\u200c\u0647\u0627\u06cc \u062e\u0648\u062f \u062f\u0631 \u0641\u0627\u06cc\u0644 \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0646\u0634\u062f\u0647 \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0631\u0627\u0647\u0646\u0645\u0627\u06cc \u0633\u0631\u06cc\u0639 \u0631\u0648\u0634 \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0644\u0627\u06af\u06cc\u0646\u06af HAProxy \u0628\u0627 Rsyslog \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0633\u0648\u06a9\u062a \u062f\u0627\u0645\u0646\u0647 \u06cc\u0648\u0646\u06cc\u06a9\u0633 \u0628\u0631\u0627\u06cc \u0627\u0641\u0632\u0627\u06cc\u0634 \u0642\u0627\u0628\u0644\u06cc\u062a \u0627\u0637\u0645\u06cc\u0646\u0627\u0646\u060c \u0633\u0631\u0639\u062a \u0648 \u0627\u0645\u0646\u06cc\u062a \u0631\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0634\u0645\u0627 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u06cc\u06a9 \u0633\u0631\u0648\u0631 \u0628\u0627 \u0633\u06cc\u0633\u062a\u0645 \u0639\u0627\u0645\u0644 Rocky Linux 8 \u062f\u0627\u0631\u06cc\u062f \u06a9\u0647 \u0628\u0627\u06cc\u062f \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u063a\u06cc\u0631 \u0631\u0648\u062a \u0628\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc\u200c\u0647\u0627\u06cc \u0645\u062f\u06cc\u0631\u06cc\u062a\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0646\u0635\u0628 HAProxy\u060c \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>dnf install haproxy\r\n<\/code><\/pre>\n<p>\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u067e\u06cc\u063a\u0627\u0645 <code>Is this ok [y\/N]:<\/code> \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0631\u062f\u06cc\u062f\u060c \u06a9\u0644\u06cc\u062f <code>y<\/code> \u0631\u0627 \u0632\u062f\u0647 \u0648 ENTER \u0631\u0627 \u0641\u0634\u0627\u0631 \u062f\u0647\u06cc\u062f \u062a\u0627 \u0646\u0635\u0628 \u0627\u0646\u062c\u0627\u0645 \u0634\u0648\u062f.<\/p>\n<p>\u067e\u0633 \u0627\u0632 \u0646\u0635\u0628 HAProxy\u060c \u0628\u0627 \u062f\u0633\u062a\u0648\u0631 <code>systemctl<\/code> \u0633\u0631\u0648\u06cc\u0633 \u0631\u0627 \u0641\u0639\u0627\u0644 \u0648 \u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>systemctl enable haproxy\r\nsystemctl start haproxy\r\n<\/code><\/pre>\n<p>\u0628\u0627 \u0641\u0639\u0627\u0644 \u0634\u062f\u0646 \u0633\u0631\u0648\u06cc\u0633 HAProxy\u060c \u0622\u0646 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u0628\u0627 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u067e\u06cc\u0634\u200c\u0641\u0631\u0636 \u0631\u0648\u06cc \u0633\u0631\u0648\u0631 \u0634\u0645\u0627 \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p>\u0633\u067e\u0633 \u0648\u0636\u0639\u06cc\u062a HAProxy \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u0633\u0631\u0648\u06cc\u0633 \u062f\u0631 \u062d\u0627\u0644 \u0627\u062c\u0631\u0627 \u0627\u0633\u062a:<\/p>\n<pre><code>systemctl status haproxy\r\n<\/code><\/pre>\n<p>\u062e\u0631\u0648\u062c\u06cc \u0628\u0627\u06cc\u062f \u0634\u0627\u0645\u0644 \u0628\u062e\u0634 <code>active (running)<\/code> \u0628\u0627\u0634\u062f. \u0627\u06af\u0631 \u0648\u0636\u0639\u06cc\u062a \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0634\u062f\u060c HAProxy \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u0634\u0648\u062f \u0648 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0645\u0631\u062d\u0644\u0647 \u062a\u0646\u0638\u06cc\u0645 \u0644\u0627\u06af\u06cc\u0646\u06af \u0628\u0631\u0648\u06cc\u062f.<\/p>\n<p>\u0628\u0639\u062f \u0627\u0632 \u062a\u0627\u06cc\u06cc\u062f \u0627\u062c\u0631\u0627 \u0628\u0648\u062f\u0646 HAProxy\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0644\u0627\u06af\u06cc\u0646\u06af \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u0644\u0627\u06af\u06cc\u0646\u06af HAProxy\u060c \u0641\u0627\u06cc\u0644 <code>\/etc\/haproxy\/haproxy.cfg<\/code> \u0631\u0627 \u0628\u0627 \u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 \u0645\u0648\u0631\u062f \u0639\u0644\u0627\u0642\u0647 \u062e\u0648\u062f \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>vi \/etc\/haproxy\/haproxy.cfg\r\n<\/code><\/pre>\n<p>\u0648\u0627\u0631\u062f \u062d\u0627\u0644\u062a INSERT \u0634\u0648\u06cc\u062f (\u062f\u06a9\u0645\u0647 <code>i<\/code>) \u0633\u067e\u0633 \u062e\u0637 <code>log 127.0.0.1 local2<\/code> \u0631\u0627 \u067e\u06cc\u062f\u0627 \u06a9\u0631\u062f\u0647 \u0648 \u0628\u0627 \u0627\u0641\u0632\u0648\u062f\u0646 <code>#<\/code> \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u06cc \u062e\u0637 \u0622\u0646 \u0631\u0627 \u06a9\u0627\u0645\u0646\u062a \u06a9\u0646\u06cc\u062f:<\/p>\n<p>\u0633\u067e\u0633 \u0645\u0633\u062a\u0642\u06cc\u0645\u0627\u064b \u0628\u0639\u062f \u0627\u0632 \u0622\u0646 \u062e\u0637\u060c \u0627\u06cc\u0646 \u062f\u0633\u062a\u0648\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>log \/dev\/log local0\r\n<\/code><\/pre>\n<p>\u0628\u062e\u0634 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0644\u0627\u06af\u06cc\u0646\u06af \u062f\u0631 <code>\/etc\/haproxy\/haproxy.cfg<\/code> \u0628\u0627\u06cc\u062f \u0645\u0634\u0627\u0628\u0647 \u0646\u0645\u0648\u0646\u0647 \u0632\u06cc\u0631 \u0628\u0627\u0634\u062f:<\/p>\n<pre><code>chroot \/var\/lib\/haproxy\r\nlog \/dev\/log local0\r\n<\/code><\/pre>\n<p>\u062e\u0637 <code>chroot<\/code> \u0627\u0647\u0645\u06cc\u062a \u062f\u0627\u0631\u062f \u0632\u06cc\u0631\u0627 \u0641\u0631\u0622\u06cc\u0646\u062f HAProxy \u0631\u0627 \u0645\u062d\u062f\u0648\u062f \u0628\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627 \u0641\u0642\u0637 \u062f\u0631 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc <code>\/var\/lib\/haproxy<\/code> \u0645\u06cc\u200c\u06a9\u0646\u062f. \u062e\u0637 <code>log \/dev\/log local0<\/code> \u0646\u06cc\u0632 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062f\u0627\u062e\u0644 \u0627\u06cc\u0646 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 Rsyslog \u0628\u0631\u0627\u06cc \u062c\u0645\u0639\u200c\u0622\u0648\u0631\u06cc \u0644\u0627\u06af\u200c\u0647\u0627 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f.<\/p>\n<p>\u0628\u0639\u062f \u0627\u0632 \u0627\u062a\u0645\u0627\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634\u060c \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0631\u062f\u0647 \u0648 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f (ESC \u0633\u067e\u0633 <code>:wq<\/code> \u0648 ENTER).<\/p>\n<p>\u06af\u0627\u0645 \u0628\u0639\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc <code>\/var\/lib\/haproxy\/dev<\/code> \u0627\u0633\u062a \u06a9\u0647 \u0628\u0647 \u0635\u0648\u0631\u062a \u067e\u06cc\u0634\u200c\u0641\u0631\u0636 \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f:<\/p>\n<pre><code>mkdir -p \/var\/lib\/haproxy\/dev\r\nsystemctl restart haproxy\r\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646 HAProxy \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0634\u062f\u0647 \u062a\u0627 \u0644\u0627\u06af\u200c\u0647\u0627\u06cc \u062e\u0648\u062f \u0631\u0627 \u0628\u0647 \u0633\u0648\u06a9\u062a \u062f\u0627\u0645\u0646\u0647 \u06cc\u0648\u0646\u06cc\u06a9\u0633 \u062f\u0631 \u0645\u0633\u06cc\u0631 <code>\/var\/lib\/haproxy\/dev\/log<\/code> \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u062f.<\/p>\n<p>\u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0628\u0639\u062f\u060c \u0628\u0627\u06cc\u062f Rsyslog \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0627\u06cc\u0646 \u0633\u0648\u06a9\u062a \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u0647 \u0648 \u0628\u0647 \u0622\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f.<\/p>\n<p>\u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u067e\u06cc\u0634\u200c\u0641\u0631\u0636 Rsyslog \u062f\u0631 Rocky Linux 8 \u0644\u0627\u06af\u200c\u0647\u0627\u06cc HAProxy \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u0631\u0627\u06cc \u062a\u0646\u0638\u06cc\u0645\u060c \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062c\u062f\u06cc\u062f <code>\/etc\/rsyslog.d\/99-haproxy.conf<\/code> \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>vi \/etc\/rsyslog.d\/99-haproxy.conf\r\n<\/code><\/pre>\n<p>\u062f\u0631 \u062d\u0627\u0644\u062a INSERT \u062e\u0637\u0648\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>$AddUnixListenSocket \/var\/lib\/haproxy\/dev\/log\r\n\r\n:programname, startswith, \"haproxy\" \/var\/log\/haproxy.log\r\n&amp; stop\r\n<\/code><\/pre>\n<p>\u062e\u0637 \u0627\u0648\u0644 \u0628\u0647 Rsyslog \u0645\u06cc\u200c\u06af\u0648\u06cc\u062f \u06a9\u0647 \u06cc\u06a9 \u0633\u0648\u06a9\u062a \u062f\u0627\u0645\u0646\u0647 \u06cc\u0648\u0646\u06cc\u06a9\u0633 \u062f\u0631 \u0645\u0633\u06cc\u0631 \u0645\u0634\u062e\u0635\u200c\u0634\u062f\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u062f. \u0628\u062e\u0634 \u062f\u0648\u0645 \u062a\u0639\u06cc\u06cc\u0646 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0644\u0627\u06af\u200c\u0647\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0633\u0648\u06a9\u062a \u062f\u0631 \u0641\u0627\u06cc\u0644 <code>\/var\/log\/haproxy.log<\/code> \u0630\u062e\u06cc\u0631\u0647 \u0634\u0648\u0646\u062f.<\/p>\n<p>\u0641\u0627\u06cc\u0644 \u0631\u0627 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0631\u062f\u0647 \u0648 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f (ESC \u0633\u067e\u0633 <code>:wq<\/code> \u0648 ENTER).<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646 Rsyslog \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0634\u062f\u0647 \u062a\u0627 \u0644\u0627\u06af\u200c\u0647\u0627 \u0631\u0627 \u0627\u0632 \u0633\u0648\u06a9\u062a \u0628\u062e\u0648\u0627\u0646\u062f \u0648 \u062f\u0631 \u0641\u0627\u06cc\u0644 \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u062f.<\/p>\n<p>\u0642\u0628\u0644 \u0627\u0632 \u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u062c\u062f\u062f Rsyslog \u0628\u0627\u06cc\u062f \u0648\u0636\u0639\u06cc\u062a SELinux \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>getenforce\r\n<\/code><\/pre>\n<p>\u0627\u06af\u0631 \u062e\u0631\u0648\u062c\u06cc <code>Permissive<\/code> \u06cc\u0627 <code>Disabled<\/code> \u0628\u0648\u062f\u060c Rsyslog \u0631\u0627 \u0628\u0627 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627\u0647\u200c\u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u062c\u062f\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>systemctl restart rsyslog\r\n<\/code><\/pre>\n<p>\u067e\u0633 \u0627\u0632 \u0627\u06cc\u0646\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0644\u0627\u06af\u200c\u0647\u0627 \u0631\u0627 \u062f\u0631 <code>\/var\/log\/haproxy.log<\/code> \u0628\u0628\u06cc\u0646\u06cc\u062f. \u0628\u0647 \u0645\u0631\u062d\u0644\u0647 \u0628\u0639\u062f &#8211; \u0622\u0632\u0645\u0627\u06cc\u0634 \u0644\u0627\u06af\u06cc\u0646\u06af HAProxy &#8211; \u0628\u0631\u0648\u06cc\u062f \u062a\u0627 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u0647\u0645\u0647 \u0686\u06cc\u0632 \u062f\u0631\u0633\u062a \u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p>\u0627\u06af\u0631 SELinux \u062f\u0631 \u062d\u0627\u0644\u062a <code>Enforcing<\/code> \u0628\u0648\u062f\u060c \u0646\u06cc\u0627\u0632 \u0627\u0633\u062a \u06cc\u06a9 \u0645\u0627\u0698\u0648\u0644 SELinux \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u0645 \u062a\u0627 \u0627\u062c\u0627\u0632\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u0633\u0648\u06a9\u062a \u0628\u0647 Rsyslog \u062f\u0627\u062f\u0647 \u0634\u0648\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0627\u0628\u062a\u062f\u0627 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u0633\u06cc\u0627\u0633\u062a Type Enforcement \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f. \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062c\u062f\u06cc\u062f \u0628\u0647 \u0646\u0627\u0645 <code>rsyslog-haproxy.te<\/code> \u0628\u0633\u0627\u0632\u06cc\u062f:<\/p>\n<pre><code>vi rsyslog-haproxy.te\r\n<\/code><\/pre>\n<p>\u062f\u0631 \u062d\u0627\u0644\u062a INSERT \u062e\u0637\u0648\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>module rsyslog-haproxy 1.0;\r\n\r\nrequire {\r\n    type rsyslogd_t;\r\n    type haproxy_var_lib_t;\r\n    class unix_stream_socket connectto;\r\n    class dir { getattr search open };\r\n}\r\n\r\n#============= rsyslogd_t ==============\r\n\r\nallow rsyslogd_t haproxy_var_lib_t:dir { getattr search open };\r\nallow rsyslogd_t haproxy_var_lib_t:unix_stream_socket connectto;\r\n<\/code><\/pre>\n<p>\u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0646\u0627\u0645 \u0645\u0627\u0698\u0648\u0644 \u0648 \u0642\u0648\u0627\u0646\u06cc\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0644\u0627\u0632\u0645 \u0631\u0627 \u0645\u0634\u062e\u0635 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u067e\u0633 \u0627\u0632 \u0627\u062a\u0645\u0627\u0645 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f (ESC \u0633\u067e\u0633 <code>:wq<\/code> \u0648 ENTER).<\/p>\n<p>\u0628\u0633\u062a\u0647 <code>checkpolicy<\/code> \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u06cc\u062f \u0641\u0627\u06cc\u0644 \u0633\u06cc\u0627\u0633\u062a \u0631\u0627 \u0628\u0647 \u0645\u0627\u0698\u0648\u0644 SELinux \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>dnf install checkpolicy\r\n<\/code><\/pre>\n<p>\u062d\u0627\u0644\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0641\u0627\u06cc\u0644 TE \u0631\u0627 \u0628\u0647 \u06cc\u06a9 \u0645\u0627\u0698\u0648\u0644 SELinux \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>checkmodule -M -m -o rsyslog-haproxy.mod rsyslog-haproxy.te\r\n<\/code><\/pre>\n<p>\u0633\u067e\u0633 \u06cc\u06a9 \u0628\u0633\u062a\u0647 \u0633\u06cc\u0627\u0633\u062a \u0628\u0631\u0627\u06cc \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0628\u0633\u0627\u0632\u06cc\u062f:<\/p>\n<pre><code>semodule_package -o rsyslog-haproxy.pp -m rsyslog-haproxy.mod\r\n<\/code><\/pre>\n<p>\u0648 \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0622\u0646 \u0631\u0627 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>semodule -i rsyslog-haproxy.pp\r\n<\/code><\/pre>\n<p>\u0635\u0628\u0631 \u06a9\u0646\u06cc\u062f \u062a\u0627 \u0639\u0645\u0644\u06cc\u0627\u062a \u062a\u0645\u0627\u0645 \u0634\u0648\u062f \u0648 \u0633\u067e\u0633 \u0628\u0627 \u0627\u06cc\u0646 \u062f\u0633\u062a\u0648\u0631 \u0645\u0637\u0645\u0626\u0646 \u0634\u0648\u06cc\u062f \u06a9\u0647 \u0645\u0627\u0698\u0648\u0644 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<pre><code>semodule -l | grep haproxy\r\n<\/code><\/pre>\n<p>\u062f\u0631 \u0646\u0647\u0627\u06cc\u062a Rsyslog \u0631\u0627 \u0631\u06cc\u0633\u062a\u0627\u0631\u062a \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>systemctl restart rsyslog\r\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u0633\u06cc\u0627\u0633\u062a SELinux \u062a\u0646\u0638\u06cc\u0645 \u0634\u062f\u0647 \u062a\u0627 HAProxy \u0648 Rsyslog \u0628\u062a\u0648\u0627\u0646\u0646\u062f \u0631\u0648\u06cc \u0633\u0648\u06a9\u062a \u0645\u0634\u062a\u0631\u06a9 \u062e\u0648\u062f \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0631\u0642\u0631\u0627\u0631 \u06a9\u0646\u0646\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0622\u0632\u0645\u0627\u06cc\u0634 \u0644\u0627\u06af\u06cc\u0646\u06af\u060c \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u0628\u0647 HAProxy \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f \u0648 \u0641\u0627\u06cc\u0644 \u0644\u0627\u06af \u062c\u062f\u06cc\u062f \u0631\u0627 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0628\u0647 \u0637\u0648\u0631 \u067e\u06cc\u0634\u200c\u0641\u0631\u0636\u060c \u0628\u0633\u062a\u0647 HAProxy \u06cc\u06a9 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u067e\u06cc\u0634\u200c\u0641\u0631\u0636 \u062f\u0627\u0631\u062f \u06a9\u0647 \u06cc\u06a9 \u0634\u0646\u0648\u0646\u062f\u0647 HTTP \u0631\u0648\u06cc \u067e\u0648\u0631\u062a \u06f5\u06f0\u06f0\u06f0 \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0627\u06cc\u0646 \u062a\u0646\u0638\u06cc\u0645 \u0628\u0647 \u06cc\u06a9 \u0633\u0631\u0648\u0631 backend \u063a\u06cc\u0631\u0645\u0648\u062c\u0648\u062f \u0627\u0634\u0627\u0631\u0647 \u062f\u0627\u0631\u062f\u060c \u067e\u0633 \u0647\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u067e\u0627\u0633\u062e \u062e\u0637\u0627\u06cc \u06f5\u06f0\u06f3 \u062f\u0631\u06cc\u0627\u0641\u062a \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u062a\u0648\u0644\u06cc\u062f \u06cc\u06a9 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u0628\u0627 Curl \u0627\u06cc\u0646 \u062f\u0633\u062a\u0648\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>curl http:\/\/localhost:5000\r\n<\/code><\/pre>\n<p>\u0628\u0627\u06cc\u062f \u062e\u0631\u0648\u062c\u06cc \u0645\u0627\u0646\u0646\u062f \u0632\u06cc\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>503 Service Unavailable\r\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646\u060c \u062f\u0631 <code>\/var\/log\/haproxy.log<\/code> \u067e\u0627\u0633\u062e\u200c\u0647\u0627\u06cc \u06f5\u06f0\u06f3 \u0631\u0627 \u062c\u0633\u062a\u062c\u0648 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>grep \"NOSRV.+503\" \/var\/log\/haproxy.log\r\n<\/code><\/pre>\n<p>\u0627\u06cc\u0646 \u062e\u0637\u200c\u0647\u0627 \u0646\u0634\u0627\u0646\u200c\u062f\u0647\u0646\u062f\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a curl \u0634\u0645\u0627 \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u062a\u062b\u0628\u06cc\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f HAProxy \u0648 Rsyslog \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0633\u0648\u06a9\u062a \u0645\u0634\u062a\u0631\u06a9 \u0628\u0647 \u062f\u0631\u0633\u062a\u06cc \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u0634\u062f\u0647\u200c\u0627\u0646\u062f.<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0633\u0631\u06cc\u0639\u060c HAProxy \u0631\u0627 \u0628\u0631\u0627\u06cc \u0644\u0627\u06af\u06cc\u0646\u06af \u0628\u0647 \u06cc\u06a9 \u0633\u0648\u06a9\u062a \u062f\u0627\u0645\u0646\u0647 \u06cc\u0648\u0646\u06cc\u06a9\u0633 \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u06a9\u0631\u062f\u06cc\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 Rsyslog \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0631\u062f\u06cc\u062f \u062a\u0627 \u0627\u06cc\u0646 \u0633\u0648\u06a9\u062a \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u0648 \u062e\u0648\u0627\u0646\u062f\u0647 \u0648 \u062f\u0631 \u0635\u0648\u0631\u062a \u0646\u06cc\u0627\u0632 \u0633\u06cc\u0627\u0633\u062a SELinux \u0631\u0627 \u0628\u0631\u0627\u06cc \u0627\u062c\u0627\u0632\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u06cc\u0646 HAProxy \u0648 Rsyslog \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u06cc\u062f.<\/p>\n<p>\u0627\u0632 \u0647\u0645\u0631\u0627\u0647\u06cc \u0634\u0645\u0627 \u0628\u0627 <strong><a href=\"https:\/\/parmin.cloud\/\">ParminCloud<\/a><\/strong> \u0633\u067e\u0627\u0633\u06af\u0632\u0627\u0631\u06cc\u0645.<\/p>\n<div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>HAProxy \u06a9\u0647 \u0645\u062e\u0641\u0641 High Availability Proxy \u0627\u0633\u062a\u060c \u06cc\u06a9 \u0633\u0631\u0648\u0631 \u067e\u0631\u0627\u06a9\u0633\u06cc \u0645\u0628\u062a\u0646\u06cc \u0628\u0631 TCP \u0648 HTTP \u0627\u0633\u062a \u06a9\u0647 \u0631\u0648\u06cc \u0644\u06cc\u0646\u0648\u06a9\u0633\u060c \u0633\u0648\u0644\u0627\u0631\u06cc\u0633 \u0648 FreeBSD \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0628\u0631\u0627\u06cc \u0645\u062a\u0639\u0627\u062f\u0644\u200c\u0633\u0627\u0632\u06cc \u0628\u0627\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627 \u0628\u0647 \u06a9\u0627\u0631 \u0645\u06cc\u200c\u0631\u0648\u062f \u062a\u0627 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u200c\u0647\u0627 \u0628\u06cc\u0646 \u0686\u0646\u062f \u0633\u0631\u0648\u0631 \u062a\u0648\u0632\u06cc\u0639 \u0634\u0648\u0646\u062f \u0648 \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062d\u0627\u0635\u0644 \u0634\u0648\u062f \u06a9\u0647 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627 \u0647\u0645\u06cc\u0634\u0647 \u0628\u0631\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0647\u0633\u062a\u0646\u062f. \u0628\u0647 \u0637\u0648\u0631 \u067e\u06cc\u0634\u200c\u0641\u0631\u0636\u060c [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":5709,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"categories":[150],"tags":[624,621,623,620,622],"class_list":["post-5705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag----haproxy--rocky-linux","tag----haproxy---","tag--haproxy--rsyslog--selinux","tag--haproxy-----","tag-----haproxy--"],"aioseo_notices":[],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"_links":{"self":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/comments?post=5705"}],"version-history":[{"count":3,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5705\/revisions"}],"predecessor-version":[{"id":5710,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5705\/revisions\/5710"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/media\/5709"}],"wp:attachment":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/media?parent=5705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/categories?post=5705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/tags?post=5705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}