近来想在自己的云服务器上安装一个博客系统,收录一些学习工作中的点滴经验。WordPress显然大了点,于是下载安装Typecho,使用sqlite3作为数据库。
安装php7.4及sqplite
apt install php-fpm
apt install php-curl php-mbstring php-sqlite3
php-sqlite3如果未安装,安装时无法显示数据库选项
修改nginx配置
与WordPress不同,typecho需要手工修改配置文件进行rewrite,否则会提示404、405错误
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
try_files $uri $uri/ /index.php =404 ;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}