安装所需运行环境
安装Caddy
安装PHP
sudo apt update && sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1-fpm php8.1 libapache2-mod-php8.1 php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl php8.1-bcmath unzip -y
安装MySQL
sudo apt install mysql-server -y
下载安装可道云
mkdir -p /usr/share/caddy
cd /usr/share/caddy
wget https://static.kodcloud.com/update/download/kodbox.1.38.zip
unzip kodbox.1.38.zip && chmod -Rf 777 ./*
配置
编辑 /etc/caddy/Caddyfile
your_website_domain { root * /usr/share/caddy file_server encode gzip php_fastcgi unix//run/php/php8.1-fpm.sock try_files {path} {path}/ /index.php?{query} }
重启Caddy
sudo service caddy stop
sudo service caddy start
配置数据库
CREATE DATABASE kodbox;
use kodbox;
CREATE USER 'kodbox'@'localhost' IDENTIFIED BY 'kodbox';
GRANT ALL ON *.* TO 'kodbox'@'localhost';
flush privileges;
浏览器配置
打开 https://your_website_domain,填入刚才创建的数据库用户名和密码。其他操作一看就懂。