{"id":2226,"date":"2019-02-13T21:51:16","date_gmt":"2019-02-13T18:51:16","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2226"},"modified":"2019-02-13T21:51:16","modified_gmt":"2019-02-13T18:51:16","slug":"installing-linux-dash-with-nginx-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/installing-linux-dash-with-nginx-on-ubuntu-18-04-lts\/","title":{"rendered":"Installing Linux Dash with Nginx on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>This guides presents a simple way installing <a href=\"https:\/\/github.com\/afaqurk\/linux-dash\/wiki\" target=\"_blank\" rel=\"noopener\">Linux Dash<\/a> with Nginx on Ubuntu 18.04 LTS. Linux Dash is an opensource web based monitoring dashboard for Linux systems. It displays system metrics and properties such as number of running processes, number of logged in users, the CPU load, memory statistic, disk usage, network connections, internet connection speed etc. You can happily check the Linux Dash demo <a href=\"https:\/\/afaqurk.github.io\/linux-dash\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<h2>Installing Linux Dash with Nginx on Ubuntu 18.04 LTS<\/h2>\n<p>Linux Dash is a small program that can be installed from source code that can be locally cloned from a <a href=\"https:\/\/github.com\/afaqurk\/linux-dash.git\" target=\"_blank\" rel=\"noopener\">Github repository<\/a>. Being a simple application, it doesn&#8217;t require any database backend. It however requires a web server such as Apache or Nginx and the server-side scripting language such as PHP.<\/p>\n<p>To begin the installation with, update and upgrade your system packages.<\/p>\n<pre>apt update\r\napt upgrade<\/code><\/pre>\n<p>Install the git package for cloning Linux Dash repository<\/p>\n<pre>apt install git<\/code><\/pre>\n<p>Install Nginx web server<\/p>\n<pre>apt install nginx<\/code><\/pre>\n<p>Install PHP<\/p>\n<pre>apt install php7.2 php7.2-curl php7.2-fpm<\/code><\/pre>\n<h3>Configure Linux Dash Nginx Server Block<\/h3>\n<p>To configure Nginx for Linux Dash, you need to create the server block configuration under <code>\/etc\/nginx\/sites-available<\/code> directory.<\/p>\n<pre>vim \/etc\/nginx\/sites-available\/linux-dash<\/code><\/pre>\n<p>Add the following contents to the configuration file and make adjustments accordingly.<\/p>\n<pre>server {\r\n    server_name     linuxdash.example.com;\r\n    listen          80;\r\n    root            \/var\/www\/html;\r\n    index           index.html index.php;\r\n    access_log      \/var\/log\/nginx\/linuxdash_access.log;\r\n    error_log       \/var\/log\/nginx\/linuxdash_error.log;\r\n \r\n    location ~* \\.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {\r\n            try_files $uri =404;\r\n            expires max;\r\n            access_log off;\r\n            add_header Pragma public;\r\n            add_header Cache-Control \"public, must-revalidate, proxy-revalidate\";\r\n    }\r\n \r\n    location \/linux-dash {\r\n        index index.html index.php;\r\n    }\r\n \r\n    location ~ \\.php(\/|$) {\r\n            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n            fastcgi_split_path_info ^(.+?\\.php)(\/.*)$;\r\n            fastcgi_pass unix:\/run\/php\/php7.2-fpm.sock;\r\n            if (!-f $document_root$fastcgi_script_name) {\r\n                    return 404;\r\n            }\r\n            try_files $uri $uri\/ \/index.php?$args;\r\n            include fastcgi_params;\r\n    }\r\n}<\/code><\/pre>\n<p>Save the configuration file and quit.<\/p>\n<p>Once that is done, you need to enable the Linux Dash site. This can be done by creating symbolic links from this server block configuration to the <code>sites-enabled<\/code> directory.<\/p>\n<pre>ln -s \/etc\/nginx\/sites-available\/linux-dash \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Next, remove the default Nginx site configuration.<\/p>\n<pre>rm -rf \/etc\/nginx\/{sites-available,sites-enabled}\/default<\/code><\/pre>\n<h3>Download Linux Dash<\/h3>\n<p>Navigate to the Linux Dash root directory and clone the its git repository there;<\/p>\n<pre>cd \/srv\r\ngit clone https:\/\/github.com\/afaqurk\/linux-dash.git<\/code><\/pre>\n<p>Set the proper ownership of the Linux Dash web directory.<\/p>\n<pre>chown -R www-data.www-data linux-dash<\/code><\/pre>\n<p>Open Nginx through firewall.<\/p>\n<pre>ufw allow \"Nginx HTTP\"<\/code><\/pre>\n<p>Verify Nginx configuration syntax<\/p>\n<pre>nginx -t\r\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\r\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n<p>Restart Nginx<\/p>\n<pre>systemctl restart nginx<\/code><\/pre>\n<p>The Linux Dash configuration is done. To check the web user interface, enter your server hostname or IP on the browser and add \/linux-dash as the suffix.<\/p>\n<pre>http:\/\/server_IP\/linux-dash<\/code><\/pre>\n<p><a href=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2019\/02\/linux-dash.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2229 size-full\" title=\"installing Linux Dash with Nginx on Ubuntu 18.04 LTS\" src=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2019\/02\/linux-dash.png\" alt=\"installing Linux Dash with Nginx on Ubuntu 18.04 LTS\" width=\"1687\" height=\"914\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/02\/linux-dash.png 1687w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/02\/linux-dash-768x416.png 768w\" sizes=\"(max-width: 1687px) 100vw, 1687px\" \/><\/a><\/p>\n<p>That was all about installing <a href=\"https:\/\/github.com\/afaqurk\/linux-dash\/wiki\" target=\"_blank\" rel=\"noopener\">Linux Dash<\/a> with Nginx on Ubuntu 18.04 LTS. Enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guides presents a simple way installing Linux Dash with Nginx on Ubuntu 18.04 LTS. Linux Dash is an opensource web based monitoring dashboard for<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,72],"tags":[330,67],"class_list":["post-2226","post","type-post","status-publish","format-standard","hentry","category-howtos","category-monitoring","tag-linux-dash","tag-ubuntu-18-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2226"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=2226"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2226\/revisions"}],"predecessor-version":[{"id":2230,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2226\/revisions\/2230"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=2226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=2226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=2226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}