玩转树莓派(五)部署WordPress建立个人博客
1 安装LNMP四件套
先安装LNMP四件套(Linux、Nginx、MaraiDB/MySQL、PHP)
安装Mariadb
cloud@server:~ $ sudo apt install -y mariadb-server
Nginx和PHP8.0已安装,见玩转树莓派(二)
2 部署WoredPress
2.1 配置Nginx
cloud@server:/var/www/html $ cd /etc/nginx/sites-available/
cloud@server:/etc/nginx/sites-available $ sudo vim blog
创建文件
server {
listen 55105;
root /var/www/blog/html;
index index.html index.htm index.nginx-debian.html index.php;
server_name blog.tangke8.com;
location / {
index index.html index.htm index.php default.html default.htm default.php;
}
location ~\.php$ {
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
创建符号链接