Here the Steps on How to Install linux-dash on Nginx, Ubuntu Server. linux-dash is a Lightweight, PHP Server Monitoring Tool Which is Easy. We are assuming a setup like we wrote in details as steps – WordPress Nginx Setup. We are assuming that you are a basic user. We discovered this linux-dash PHP, Node.js, Go, compatible web tool from GitHub. The GUI looks great and easy to use. At this moment, you will use the original linux-dash.
Needed Setup to Install linux-dash on Nginx, The PHP Server Monitoring Tool
We are taking it as a fresh cloud server instance. We suggest to use Nginx Extras instead of Nginx as cache purge module is available with Nginx Extras. We need to install these components :
1 | apt-get install git nginx-extras curl php5-json php5-common php5-fpm php5-curl |
We suggest not to change default Nginx file names and path of root for easy troubleshooting over the Internet on Q&A sites like StackExchange. We will change directory to default Nginx root of public FTP :
---
1 | cd /usr/share/nginx/html/ |
Then we will clone this repo of linux-dash :
1 | https://github.com/afaqurk/linux-dash |
Here we go :
1 2 3 4 | git clone https://github.com/afaqurk/linux-dash.git ## for root installation on subdomain # cp -r linux-dash/ /usr/share/nginx/html chown -R www-data:www-data /usr/share/nginx/html |
Now, we will edit the file /etc/nginx/sites-available/default
:
1 | nano /etc/nginx/sites-available/default |
This is an example configuration, note that /usr/share/nginx/html
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | upstream php5-fpm-sock { server unix:/var/run/php5-fpm.sock; } server { server_name dash.domain.com; listen 80; root /usr/share/nginx/html/linux-dash; index index.php index.html module.php; access_log /var/log/nginx/linux-dash-access.log; error_log /var/log/nginx/linux-dash-error.log; location ~ \.php$ { try_files $uri =404; root /usr/share/nginx/html/linux-dash; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } |
Open php.ini
, locate the disable_the functions line to make sure that shell_exec
and exec
are not listed. Restart the services :
1 2 | service php5-fpm restart service nginx restart |
Navigate to http://your-ip/linux-dash/
to see the stuffs. Now you should have an insight into server’s status through the linux dash dashboard.
Conclusion : PHP Server Monitoring Tool linux-dash
For support, general community support and questions, please see the repo page on GitHub.
We in previously published article shown a pretty sweet dashboard for our infrastructure using Graphite, Grafana and collectd. That was a difficult to handle by an ordinary user. This is easier & practical.
As linux dash gives access to sensitive information, you need to restrict access to this directory. This is Nginx documentation on password protecting a directory :
1 | http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html |
and run service nginx restart
, it makes the interface inaccessible to all. This block needs to be added :
1 2 3 4 | location /linux-dash { auth_basic "Restricted Area"; auth_basic_user_file /etc/nginx/conf/.htpasswd; } |
conf/htpasswd
itself means that the code will use the htpasswd
file in /etc/nginx/conf/
directory but we used the full path. To generate that .htpasswd
file, you can use this kind of service :
1 | http://www.tools.dynamicdrive.com/password/ |
Or use this :
1 2 3 4 | cd /opt wget https://gist.github.com/AbhishekGhosh/3dfa200a82134c5f68f5c506c826c986/raw/8fc1a0dd15197a4cdaca67db264be94a41cae76d/htpasswd.py chmod 755 /opt/htpasswd.py htpasswd.py -c -b /etc/nginx/conf/.htpasswd username password |
Obviously, change username
and password
to real one. I do not know why most of the websites suggest to run :
1 | apt-get install apache2-utils |
for only generating the .htpasswd
file. There is openssl passwd
command, PHP, Perl to do the same work.