首先,需要安装的清单有:nginx、PHP7.*、git
1.安装nginx
sudo apt-get update
sudo apt-get install nginx
2.安装PHP
查看自己的PHP版本列表
sudo apt-cache search php
安装可用的7.3版本
sudo apt-get install nginx php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi
3.启动nginx,PHP
sudo service nginx start
sudo service php7.3-fpm restart
4.下载git,pi Dashboard,赋予权限
sudo apt-get install git
cd /var/www/html
sudo git clone https://github.com/spoonysonny/pi-dashboard.git
sudo chown -R www-data pi-dashboard
5.修改下nginx配置
sudo vim /etc/nginx/sites-available/default
注释里面的相同配置,注意成对大括号,修改为下面的配置
location / {
index index.html index.htm index.php default.html default.htm default.php;
}
location ~\.php$ {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
6.nginx重启
sudo service nginx restart
7.大功告成
浏览器输入http://你的IP/pi-dashboard/直接就访问到了