欢迎光临散文网 会员登陆 & 注册

玩转树莓派之LNMP typecho 监控面板与防火墙

2017-11-24 20:45 作者:王忘杰-王土狗  | 我要投稿


LNMP

ubuntu mate系统的软件都很新,php默认版本都已经是php7了,phpfpm默认也是sock文件运行,mysql默认版本是5.7

配置环境
安装mysql会提示输入mysqlroot密码,请务必牢记。

sudo apt-get install nginx mysql-server php pdo_mysql php7.0-xml php-curl php-mbstring

nginx默认站点配置文件是/etc/nginx/sites-enabled/default 请删除

新建/etc/nginx/conf.d/web.conf

server {    listen 80;        access_log  /var/log/nginx/html.log;        root   /var/www/html;        index  index.php index.html index.htm;    location ~ .*\.php(\/.*)*$ {fastcgi_pass unix:/run/php/php7.0-fpm.sock;        fastcgi_split_path_info ^(.+?\.php)(/.*)$;        fastcgi_param PATH_INFO $fastcgi_path_info;        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        include fastcgi_params;    }    }

这样我们的web根目录就是/var/www/html

由于nginx默认运行用户是www-data,我们可以在网站程序部署后通过sudo chown www-data:www-data html -R重置网站目录权限

sudo nginx -t 测试nginx配置文件 sudo nginx -s reload 重载nginx配置文件

访问 http://9sb.org:8080/

安装typecho

配置数据库推荐使用adminer.php https://9sb.org/281

typecho安装教程可以看我之前的文章 https://9sb.org/551

监控面板

Pi Dashboard (Pi 仪表盘)

sudo apt-get install git cd /var/www/html/ sudo git clone https://github.com/spoonysonny/pi-dashboard.git sudo mv pi-dashboard/ pisudo chown -R www-data:www-data pi/

访问 http://9sb.org:8080/pi/

防火墙

ubuntu mate默认使用ufw管理防火墙

sudo ufw enable 启动防火墙 sudo ufw allow 80 开启web 80端口 sudo ufw allow 22 开启ssh 22端口 sudo ufw status 查看防火墙状态 sudo ufw delete allow 80 关闭web 80端口 sudo ufw disable 关闭防火墙


玩转树莓派之LNMP typecho 监控面板与防火墙的评论 (共 条)

分享到微博请遵守国家法律