{"id":595,"date":"2018-08-20T21:04:19","date_gmt":"2018-08-20T12:04:19","guid":{"rendered":"http:\/\/www.ranran.mydns.jp\/blog\/?p=595"},"modified":"2018-09-23T09:31:36","modified_gmt":"2018-09-23T00:31:36","slug":"goaccess%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%aa%e3%82%a2%e3%83%ab%e3%82%bf%e3%82%a4%e3%83%a0%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e8%a7%a3%e6%9e%90%e3%82%92%e8%a1%8c%e3%81%86","status":"publish","type":"post","link":"http:\/\/www.ranran.mydns.jp\/blog\/?p=595","title":{"rendered":"GoAccess\u3092\u4f7f\u3063\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30a2\u30af\u30bb\u30b9\u89e3\u6790\u3092\u884c\u3046"},"content":{"rendered":"<p>Ubuntu 16.04 + Nginx \u306bGoAccess\u3092\u4f7f\u3063\u305f\u30ea\u30a2\u30eb\u30a2\u30a4\u30e0\u30a2\u30af\u30bb\u30b9\u89e3\u6790\u306e\u74b0\u5883\u3092\u4f5c\u3063\u305f\u306e\u3067\u305d\u306e\u5185\u5bb9\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\uff11\uff0eGoAccess\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u3053\u308c\u306f<a href=\"https:\/\/www.vultr.com\/docs\/how-to-install-goaccess-on-ubuntu-16-04\" target=\"_blank\" rel=\"noopener\">\u516c\u5f0f\u306e\u624b\u9806<\/a>\u3092\u53c2\u8003\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\/\/ \u5fc5\u8981\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n$ sudo apt-get -y install libncursesw5-dev gcc make\r\n$ sudo apt-get -y install libgeoip-dev libtokyocabinet-dev\r\n\r\n\/\/ GoAccess\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\n$ wget http:\/\/tar.goaccess.io\/goaccess-1.2.tar.gz\r\n\r\n\/\/ \u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n$ tar -xzvf goaccess-1.2.tar.gz\r\n$ cd goaccess-1.2\r\n$ sudo .\/configure --enable-utf8 --enable-geoip=legacy\r\n$ sudo make\r\n$ sudo make install\r\n$ sudo ln -s \/usr\/local\/bin\/goaccess \/usr\/bin\/goaccess\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3089\u8a66\u3057\u306b\u89e3\u6790\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo goaccess \/var\/log\/nginx\/access.log --log-format=COMBINED\r\n<\/pre>\n<p>\u3053\u3093\u306a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n<a href=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/08\/9c05be719e20f8cdfe6d96d0cdabefeb.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-598 size-thumbnail\" src=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/08\/9c05be719e20f8cdfe6d96d0cdabefeb-400x300.png\" alt=\"\" width=\"400\" height=\"300\" \/><\/a><a href=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/09\/GoAccess\u89e3\u6790_\u30b3\u30f3\u30bd\u30fc\u30eb.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-612 size-thumbnail\" src=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/09\/GoAccess\u89e3\u6790_\u30b3\u30f3\u30bd\u30fc\u30eb-400x300.png\" alt=\"\" width=\"400\" height=\"300\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u3055\u3066\u3001GoAccess\u306f\u89e3\u6790\u7d50\u679c\u3092HTML\u3068\u3057\u3066\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3001<br \/>\n\u3055\u3089\u306b &#8211;real-time-html \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u5e38\u6642\u60c5\u5831\u304c\u66f4\u65b0\u3055\u308c\u308bHTML\u3092\u51fa\u529b\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u60c5\u5831\u66f4\u65b0\u306e\u901a\u4fe1(WebSocket)\u306b 7890\u756a\u30dd\u30fc\u30c8\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081FW\u3092\u958b\u653e\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo ufw allow 7890\r\n<\/pre>\n<p>\u203b \u30eb\u30fc\u30bf\u30fc\u306e\u958b\u653e\u306a\u3069\u3082\u5fc5\u8981\u3067\u3059\u304c\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n<p>\u958b\u653e\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u89e3\u6790HTML\u3092\u51fa\u529b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ sudo goaccess \/var\/log\/nginx\/access.log -a -o \/usr\/share\/nginx\/html\/report.html --real-time-html --log-format=COMBINED\r\n<\/pre>\n<p>http:\/\/[\u30db\u30b9\u30c8\u540d or IP\u30a2\u30c9\u30ec\u30b9]\/report.html \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u4ee5\u4e0b\u3088\u3046\u306a\u753b\u9762\u304c\u898b\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/08\/f266ec82bb1c746aa1ddb2f295a6cce9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-599 size-thumbnail\" src=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/08\/f266ec82bb1c746aa1ddb2f295a6cce9-400x300.png\" alt=\"\" width=\"400\" height=\"300\" \/><\/a><a href=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/09\/GoAccess\u89e3\u6790_Web.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-611 size-thumbnail\" src=\"http:\/\/www.ranran.mydns.jp\/blog\/wp-content\/uploads\/2018\/09\/GoAccess\u89e3\u6790_Web-400x300.png\" alt=\"\" width=\"400\" height=\"300\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\uff12\uff0e\u30b5\u30fc\u30d3\u30b9\u5316\u3059\u308b<br \/>\n\u5e38\u6642\u8d77\u52d5\u3059\u308b\u306b\u306f\u6bce\u56de\u5148\u307b\u3069\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u308f\u3051\u306b\u306f\u3044\u304d\u307e\u305b\u3093\u306e\u3067\u3001<\/p>\n<p>\u4eca\u56de\u306f\u30b5\u30fc\u30d3\u30b9\u5316\u3057\u3066\u5e38\u6642\u8d77\u52d5\u3059\u308b\u72b6\u614b\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\/\/ \u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\r\n$ sudo vi \/etc\/systemd\/system\/goaccess.service\r\n\u2193\u2193 \u8a18\u8f09\r\n&#x5B;Unit]\r\nDescription=Goaccess Web log report.\r\nAfter=network.target\r\n\r\n&#x5B;Service]\r\nType=simple\r\nUser=root\r\nGroup=root\r\nRestart=always\r\nExecStart=\/usr\/local\/bin\/goaccess -a -g -f \/var\/log\/nginx\/access.log -o \/usr\/share\/nginx\/html\/report.html --real-time-html --log-format=COMBINED --ws-url &lt;host\u540d&gt;\r\nStandardOutput=null\r\nStandardError=null\r\n\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n\u2191\u2191 \u8a18\u8f09\r\n\r\n\/\/ \u30b5\u30fc\u30d3\u30b9\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u305f\u304b\u78ba\u8a8d\r\n$ sudo systemctl list-unit-files --type=service | grep goaccess\r\ngoaccess.service disabled \u2190 \u8868\u793a\u3055\u308c\u308c\u3070OK\r\n\r\n\/\/ \u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u5316\r\n$ sudo systemctl enable goaccess\r\n\r\n\/\/ \u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\r\n$ sudo systemctl start goaccess\r\n\r\n\/\/ \u30b5\u30fc\u30d3\u30b9\u72b6\u614b\u78ba\u8a8d\r\n$ sudo systemctl status goaccess\r\n\u25cf goaccess.service - Goaccess Web log report.\r\nLoaded: loaded (\/etc\/systemd\/system\/goaccess.service; enabled; vendor preset: enabled)\r\nActive: active (running) since \u6708 2018-08-20 16:46:27 JST; 4h 5min ago\r\nMain PID: 91584 (goaccess)\r\nTasks: 3\r\nMemory: 3.7M\r\nCPU: 1min 7.536s\r\nCGroup: \/system.slice\/goaccess.service\r\nmq91584 \/usr\/local\/bin\/goaccess -a -g -f \/var\/log\/nginx\/access.log -o \/usr\/share\/nginx\/html\/report.html -\r\n\r\n8\u6708 20 16:46:27 MainServer systemd&#x5B;1]: Started Goaccess Web log report..\r\n\r\n<\/pre>\n<p>\u8d77\u52d5\u3067\u304d\u305f\u3089\u5148\u307b\u3069\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046<br \/>\n\u304d\u3061\u3093\u3068\u89e3\u6790\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u8a2d\u5b9a\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3042\u3068\u306f\u5fc5\u8981\u3067\u3042\u308c\u3070\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u8a2d\u3051\u308b\u306a\u3069\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 16.04 + Nginx \u306bGoAccess\u3092\u4f7f\u3063\u305f\u30ea\u30a2\u30eb\u30a2\u30a4\u30e0\u30a2\u30af\u30bb\u30b9\u89e3\u6790\u306e\u74b0\u5883\u3092\u4f5c\u3063\u305f\u306e\u3067\u305d\u306e\u5185\u5bb9\u3092\u30e1\u30e2\u3002 &nbsp; \uff11\uff0eGoAccess\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u3053\u308c\u306f\u516c\u5f0f\u306e\u624b\u9806\u3092\u53c2\u8003\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002 \/ [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,38,46,30,34,35],"tags":[],"class_list":["post-595","post","type-post","status-publish","format-standard","hentry","category-goaccess","category-linux","category-nginx","category-oss","category-34","category-35"],"_links":{"self":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=595"}],"version-history":[{"count":10,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/595\/revisions"}],"predecessor-version":[{"id":614,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/595\/revisions\/614"}],"wp:attachment":[{"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ranran.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}