记录下博客搭建过程,没有用面板和一键脚本(会添加一些多余的东西感觉太臃肿了)

系统为Debian11

  1. 首先安装nginx,php,sqlite

    apt install nginx sqlite3 php7.4 php7.4-fpm php7.4-curl php7.4-sqlite3 php7.4-mbstring
    Bash
  2. 如果使用的是Alpine Linux 请安装以下软件包

    apk add nginx php81 php81-fpm php81-curl php81-sqlite3 php81-mbstring php81-json php81-ctype php81-session php81-tokenizer
    Bash
  3. 然后执行以下命令

    rc-update add php-fpm81
    rc-update add nginx
    Bash
  4. 然后下载Typecho的安装包,下载完成后解压到指定位置
  5. 给typecho文件夹赋予权限

    chmod -Rf 755 typecho
    Bash
  6. 进入typecho文件夹为usr文件夹赋权

    chmod -Rf 777 usr/
    Bash
  7. 然后修改nginx的反向配置文件

    server { listen 12345; root /var/www/typecho; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.4-fpm.sock; # fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
    nginx
  8. 然后输入检查nginx配置文件的命令

    nginx -t
    Bash
  9. 重启nginx使配置生效

    nginx -s reload
    Bash