手机安装Typecho博客

typechobanner

继上次在手机里安装了Debian后,安装Typecho博客系统

  1. 安装Nginx、PHP、MariaDB等

    这些软件安装基本没什么需要注意的,网上很多LNPM环境搭建的教程,这里放一个阿里云帮助中心的教程:LNMP环境安装

    注意:上面的教程里安装的是Mysql,可以选择安装MariaDB

  2. 安装php的mysqli拓展并启动

    1
    2
    3
    4
    apt install php-mysqli

    可以安装sqlite
    apt install php-sqlite3

    启动mysqli

    1
    2
    3
    nano /etc/php/7.4/fpm/php.ini

    extension=mysqli
  3. 安装php的mbstring拓展并启动(同上)

  4. 创建Nginx配置文件

    1
    cp /etc/nginx/site-enable/default /etc/nginx/site-enable/myblog

    修改 监听端口root目录 为自己想设置的,手机中的 80443 端口也被禁了

    并修改以下配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    #添加
    if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php$1 last;
    }
    #原来的
    location ~ .*\\.php$

    #修改为
    location ~ .*\\.php(\\/.*)*$ {
    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;
    }
  5. 下载并上传Typecho文件

    我是下载链接
  6. 我这里用了Freewind主题

    Freewind作者博客地址