技术:PHP+Nginx+SQLite 系统刷的超频版1.6 加上网站和主题安装完后还有2.1G

安装Nginx

这是一个小型的nginx只有必要的组件
sudo apt-get update更新
sudo apt-get install nginx-light
安装完的其他用得到的命令:
sudo systemctl start nginx启动
sudo systemctl status nginx查看状态
sudo systemctl enable nginx 设置为自启动

配置Nginx服务器。打开Nginx配置文件/etc/nginx/sites-available/default,并将以下内容添加到server块中:

server {
    listen 80;
    server_name your_domain.com; # 将此处替换为您的域名或IP地址
    root /var/www/typecho;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.x-fpm.sock; # 将此处替换为您的PHP版本号
    }
}

这边我就建议你server_name后面你要是不会配置就跟上连接ipv4的ip地址,php版本号你就写你安装的我这里安装的是7.4.4所以我就写7.4就行。

安装PHP

sudo apt-get update
sudo apt-get install php7.4 php7.4-fpm php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-xml php7.4-zip
使用的是Nginx,则还需要安装php-fpm扩展
sudo apt-get install php-fpm
对于SQLite的扩展安装这个

安装其他常用模块

php -v 查看PHP版本

安装数据库

sudo apt-get install sqlite3
sqlite3 --version

typecho

https:删//typecho.删org删/download这是官网连接下载解压到 /var/www/typecho下面typecho自己创建个文件夹
修改权限:
sudo chmod -R 755 /var/www/html/typecho
sudo chown -R www-data:www-data /var/www/html/typecho

最后

全部配置完毕后就重启一下。
sudo systemctl restart nginx
sudo systemctl restart php7.x-fpm # 将此处替换为您的PHP版本号
然后浏览器访问棒子连接的那个内网ip 192.168.x.x 你要是不知道你就ip addr show看一看,或者到路由器后台看看。
博客自己日常使用是没有问题的。
任务: 118 total, 1 running, 116 sleeping, 1 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.5 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.1 hi, 0.1 si, 0.0 st
MiB Mem : 461.8 total, 242.7 free, 92.7 used, 126.4 buff/cache
MiB Swap: 230.9 total, 230.9 free, 0.0 used. 352.6 avail Mem