如何在Debian 9上安装Bludit CMS
杨和超
・6 分钟阅读
使用不同的系统?
- 如何在Ubuntu 18.04 LTS上安装Bludit CMS
- 如何在CentOS 7上安装Bludit CMS
- 如何在Fedora 28上安装Bludit CMS
- 如何在FreeBSD 12上安装Bludit CMS
Bludit是一个简单,快速,灵活的博客CMS ,Bludit使用JSON格式的文件来存储内容,因此不需要安装或配置数据库,Bludit源代码托管在github ,本指南将向你展示如何在新的Debian9实例上安装BluditCMS。
要求
- PHP版本5.3或更高版本,有以下扩展:
mbstring
gd
dom
json
- 有PHP支持的Web服务器,如Nginx,apache,lighttpd,H2O ,本指南将使用Nginx ,
开始之前
查看Debian版本。
lsb_release -ds
# Debian GNU/Linux 9.5 (stretch)
确保你的系统是最新的。
apt update && apt upgrade -y
安装所需软件包。
apt install -y sudo zip unzip
使用sudo
访问创建一个新的non-root
用户帐户,并且切换到它。
adduser johndoe --gecos"John Doe"
usermod -aG sudo johndoe
su - johndoe
注:将johndoe
替换为你的用户名。
设置时区。
sudo dpkg-reconfigure tzdata
安装PHP
安装PHP和所需的PHP扩展。
sudo apt install -y php7.0 php7.0-cli php7.0-fpm php7.0-common php7.0-mbstring php7.0-gd php7.0-xml php7.0-json
检查版本。
php --version
# PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
# Copyright (c) 1997-2017 The PHP Group
# Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
# with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
安装Nginx
Bludit可以使用许多支持PHP的Web服务器,在本指南中,我们将使用Nginx 。
安装Nginx 。
sudo apt install -y nginx
检查版本。
sudo nginx -v
# nginx version: nginx/1.10.3
运行 sudo vim /etc/nginx/sites-available/bludit.conf
并为Bludit配置Nginx
server {
listen 80;
server_name example.com;
root /var/www/bludit;
index index.php;
location ~ .php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ^~ /bl-content/tmp/ { deny all; }
location ^~ /bl-content/pages/ { deny all; }
location ^~ /bl-content/databases/ { deny all; }
}
保存文件并退出。
通过将文件链接到sites-enabled
目录来激活新的bludit.conf
配置。
sudo ln -s /etc/nginx/sites-available/bludit.conf /etc/nginx/sites-enabled/
测试Nginx配置。
sudo nginx -t
重新加载Nginx 。
sudo systemctl reload nginx.service
安装Bludit
创建文档root目录。
sudo mkdir -p /var/www/bludit
将/var/www/bludit
目录的所有权更改为johndoe
。
sudo chown -R johndoe:johndoe /var/www/bludit
从官方网页下载最新版本,并且解压压缩文件。
cd /var/www/bludit
wget https://df6m0u2ovo2fu.cloudfront.net/builds/bludit-2-3-4.zip
unzip bludit-2-3-4.zip
rm bludit-2-3-4.zip
mv bludit-2-3-4/* . && mv bludit-2-3-4/.* .
rmdir bludit-2-3-4
注:如果有更新的版本,请更新下载网址。
将/var/www/bludit
目录的所有权更改为www-data
。
sudo chown -R www-data:www-data /var/www/bludit
在网页浏览器中打开站点,将出现Bludit安装程序"页面。
按照Bludit安装程序配置你的网站,若要访问管理区域,请将/admin
附加到网站URL 。