如何在 Debian 10 上安装 Kanboard 项目管理软件
在此页
- 要求
- 开始
- 安装 LEMP 服务器
- 为 Kanboard 配置 MariaDB
- 安装看板
- 为 Kanboard 配置 Nginx
- 访问看板网络界面
Kanboard 是一款免费、开源和自托管的项目管理软件,可用于使用看板方法管理项目。您可以通过 Kanboard Web 界面可视化工作流程,限制正在进行的工作并高效工作。看板使您能够根据需要自定义看板。您可以使用插件和第三方服务扩展 Kanbord 的功能。
在本教程中,我们将逐步指导您了解如何在 Debian 10 上安装和配置 Kanboard。
要求
- 运行 Debian 10 的服务器。
- 在您的服务器上配置了根密码。
入门
建议使用最新版本更新您的系统。您可以使用以下命令更新所有软件包:
apt-get update -y
apt-get upgrade -y
更新所有软件包后,重新启动系统以应用配置更改。
安装 LEMP 服务器
Kanboard 在网络服务器上运行,用 PHP 编写,并使用 MariaDB 作为数据库后端。因此,您需要在系统中安装 Nginx、MariaDB、PHP 和其他 PHP 模块。
apt-get install nginx mariadb-server php7.3 php7.3-common php7.3-cli php7.3-fpm php7.3-mbstring php7.3-json php7.3-opcache php7.3-zip php7.3-xml php7.3-gd php7.3-ldap php7.3-mysql php7.3-json php7.3-sqlite3
安装完成后,启动 Nginx 和 MariaDB 服务,并使用以下命令使它们在系统重启后启动:
systemctl start nginx
systemctl start mariadb
systemctl enable nginx
systemctl enable mariadb
为 Kanboard 配置 MariaDB
默认情况下,MariaDB 不受保护,因此建议对其进行保护。您可以通过运行以下脚本来保护它。
mysql_secure_installation
如下图所示回答所有问题:
Enter current password for root (enter for none):
Set root password? [Y/n]: N
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
MariaDB 安全后,登录到 MariaDB shell:
mysql -u root -p
出现提示时输入你的 root 密码,然后为 Kanboard 创建一个数据库和用户:
MariaDB [(none)]>CREATE DATABASE kanboard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
接下来,使用以下命令授予 Kanboard 数据库所有权限:
MariaDB [(none)]>GRANT ALL PRIVILEGES ON kanboard.* TO 'kanboard'@'localhost' IDENTIFIED BY 'mypassword';
将单词 mypassword 替换为您在上述 SQL 命令中选择的安全密码。接下来,使用以下命令刷新权限:
MariaDB [(none)]>FLUSH PRIVILEGES;
最后,使用以下命令退出 MariaDB shell:
MariaDB [(none)]>\q
安装看板
首先,使用以下命令从 Git 存储库下载最新版本的 Kanboard:
wget https://github.com/kanboard/kanboard/archive/v1.2.10.tar.gz
下载完成后,使用以下命令解压缩下载的文件:
tar -xvf v1.2.10.tar.gz
接下来,使用以下命令将提取的目录复制到 Apache Web 根目录:
cp -r kanboard-1.2.10 /var/www/html/kanboard
接下来,使用以下命令复制 Kanboard 示例配置文件:
cd /var/www/html/kanboard
cp config.default.php config.php
接下来,使用您喜欢的编辑器打开 config.php 文件:
nano config.php
定义您的数据库设置,如下所示:
// Database driver: sqlite, mysql or postgres (sqlite by default)
define('DB_DRIVER', 'mysql');
// Mysql/Postgres username
define('DB_USERNAME', 'kanboard');
// Mysql/Postgres password
define('DB_PASSWORD', 'password');
// Mysql/Postgres hostname
define('DB_HOSTNAME', 'localhost');
// Mysql/Postgres database name
define('DB_NAME', 'kanboard');
完成后保存并关闭文件。然后,使用以下命令设置适当的权限:
chown -R www-data:www-data /var/www/html/kanboard
完成后,您可以继续下一步。
为看板配置 Nginx
接下来,您需要为 Kanboard 创建一个 Nginx 虚拟主机文件。您可以使用以下命令创建它:
nano /etc/nginx/conf.d/kanboard.conf
添加以下行:
server {
listen 80;
server_name example.com;
index index.php;
root /var/www/html/kanboard;
client_max_body_size 32M;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* ^.+\.(log|sqlite)$ {
return 404;
}
location ~ /\.ht {
return 404;
}
location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
log_not_found off;
expires 7d;
etag on;
}
gzip on;
gzip_comp_level 3;
gzip_disable "msie6";
gzip_vary on;
gzip_types
text/javascript
application/javascript
application/json
text/xml
application/xml
application/rss+xml
text/css
text/plain;
}
完成后保存并关闭文件。然后,使用以下命令检查 Nginx 是否存在任何语法错误:
nginx -t
您应该看到以下输出:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
最后,使用以下命令重启 Nginx 和 php-fpm 服务:
systemctl restart nginx
systemctl restart php7.3-fpm
您可以使用以下命令检查 Nginx 服务的状态:
systemctl status nginx
您应该看到以下输出:
? nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-07-13 06:05:09 EDT; 26s ago
Docs: man:nginx(8)
Process: 13412 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 13413 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 13414 (nginx)
Tasks: 2 (limit: 1138)
Memory: 2.9M
CGroup: /system.slice/nginx.service
??13414 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
??13415 nginx: worker process
Jul 13 06:05:09 debian systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 13 06:05:09 debian systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Jul 13 06:05:09 debian systemd[1]: Started A high performance web server and a reverse proxy server.
访问看板网页界面
Kanboard 现已安装和配置,是时候访问 Kanboard Web 界面了。
打开 Web 浏览器并输入 URL http://example.com。您将被重定向到以下页面:

以 admin/admin 提供默认管理员用户名和密码,然后单击“登录”按钮。您应该在以下页面中看到 Kanboard 默认仪表板:

建议更改您的默认管理员密码。为此,请转至管理 > 用户管理 > 管理。您应该会看到以下页面:

现在,单击更改密码按钮。您应该会看到以下页面:

提供您的新密码,然后单击“保存”按钮。
恭喜!您已在 Debian 10 上成功安装和配置 Kanboard。您现在可以从 Kanboard Web 界面轻松管理您的任务。如果您有任何问题,请随时问我。