{"id":115,"date":"2018-10-20T22:21:06","date_gmt":"2018-10-20T19:21:06","guid":{"rendered":"https:\/\/artem.services\/?p=115"},"modified":"2018-11-09T11:46:26","modified_gmt":"2018-11-09T08:46:26","slug":"awstats-nginx","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=115","title":{"rendered":"AWStats &#8212; Nginx"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"size-full wp-image-203 aligncenter\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/AWStats-Nginx-Logo.png\" alt=\"\" width=\"868\" height=\"177\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/AWStats-Nginx-Logo.png 868w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/AWStats-Nginx-Logo-300x61.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/AWStats-Nginx-Logo-768x157.png 768w\" sizes=\"(max-width: 868px) 100vw, 868px\" \/><\/p>\n<p><strong>AWStats<\/strong> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043b\u043e\u0433\u043e\u043c <strong>Apache<\/strong>, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0441 \u043b\u043e\u0433\u043e\u0432 <strong>Nginx<\/strong>&#39;a.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <strong>Awstats<\/strong> \u0438 \u043c\u043e\u0434\u0443\u043b\u044c <strong>GeoIP<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nyum install awstats htmldoc GeoIP perl-Geo-IP\r\n<\/pre>\n<p>\u0421\u0442\u0430\u0432\u0438\u043c <strong>Perl<\/strong> \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nyum -y install spawn-fcgi fcgi-devel wget\r\nyum -y groupinstall &quot;Development Tools&quot;\r\nmkdir \/tmp\/perl &amp;&amp; cd \/tmp\/perl &amp;&amp; wget http:\/\/github.com\/gnosek\/fcgiwrap\/tarball\/master -O fcgiwrap.tar.gz\r\ntar -xf fcgiwrap.tar.gz &amp;&amp; cd gnosek-fcgiwrap-*\r\n\r\nautoreconf -i\r\n.\/configure\r\nmake\r\nmake install\r\n<\/pre>\n<p><!--more--><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u043e\u043f\u0446\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/sysconfig\/spawn-fcgi\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nOPTIONS=&quot;-u nginx -g nginx -a 127.0.0.1 -p 9001 -P \/var\/run\/spawn-fcgi.pid -- \/usr\/local\/sbin\/fcgiwrap&quot;\r\n<\/pre>\n<p>\u0421\u0442\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable spawn-fcgi\r\nsystemctl start spawn-fcgi\r\n<\/pre>\n<p>\u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c <strong>access<\/strong> \u043b\u043e\u0433 <strong>Nginx<\/strong>&#39;a \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/nginx\/nginx.conf\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nlog_format stats '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '\r\n'$status $body_bytes_sent &quot;$http_referer&quot; '\r\n'&quot;$http_user_agent&quot;';\r\n<\/pre>\n<p>\u041f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e <strong>Nginx<\/strong>&#39;a.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <strong>AWStats<\/strong> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/awstats\/awstats.artem.services.conf\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nLogFile=&quot;\/var\/log\/nginx\/access.log&quot;\r\nLogFormat=1\r\nSiteDomain=&quot;artem.services&quot;\r\nHostAliases=&quot;localhost&quot;\r\nDNSLookup=0\r\nDirData=&quot;\/var\/lib\/awstats\/artem.services&quot;\r\nAllowToUpdateStatsFromBrowser=1\r\nLoadPlugin=&quot;geoip GEOIP_STANDARD \/usr\/share\/GeoIP\/GeoIP.dat&quot;\r\nLang=&quot;ru&quot;\r\n<\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 <strong>AWStats<\/strong> \u0432 \u0434\u0438\u0440\u0438\u043a\u0442\u043e\u0440\u0438\u044e \u0432\u0435\u0431\u0430, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncp -a \/usr\/share\/awstats\/wwwroot\/cgi-bin\/* \/home\/artem\/web\/awstats\/\r\n<\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 <strong>Nginx<\/strong>&#39;a \u0434\u043b\u044f <strong>AWStats<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nserver {\r\n    listen 80;\r\n    server_name artem.services;\r\n    root \/home\/artem\/web\/awstats;\r\n\r\n    location \/ {\r\n        rewrite ^ http:\/\/artem.services\/awstats.pl?config=artem.services;\r\n    }\r\n\r\n    location \/icon\/ {\r\n        alias \/usr\/share\/awstats\/wwwroot\/icon\/;\r\n    }\r\n\r\n    location \/css\/ {\r\n        alias \/usr\/share\/awstats\/wwwroot\/css\/;\r\n    }\r\n\r\n    location \/js\/ {\r\n        alias \/usr\/share\/awstats\/wwwroot\/js\/;\r\n    }\r\n\r\n    location ~ \\.pl$ {\r\n        access_log off;\r\n        fastcgi_pass   127.0.0.1:9001;\r\n        fastcgi_index  awstats.pl;\r\n        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        include        \/etc\/nginx\/fastcgi_params;\r\n    }\r\n}\r\n<\/pre>\n<p>\u0423 \u043c\u0435\u043d\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c, \u043d\u043e \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0438\u043c\u0435\u043d\u0438 \u0434\u043e\u043c\u0435\u043d\u0430, \u0430 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c \u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u0432 \u043a\u0440\u043e\u043d \u0443\u0448\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget -O \/dev\/null http:\/\/artem.services\/awstats\/awstats.pl?framename=mainright\\&amp;update=1\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; AWStats \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043b\u043e\u0433\u043e\u043c Apache, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0441 \u043b\u043e\u0433\u043e\u0432 Nginx&#39;a. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Awstats \u0438 \u043c\u043e\u0434\u0443\u043b\u044c GeoIP \u0421\u0442\u0430\u0432\u0438\u043c Perl \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41],"tags":[16,10],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/115"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=115"}],"version-history":[{"count":7,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/115\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}