可道云在wsl ubuntu下部署
本次在win10 使用ubuntu wsl进行部署
环境准备
win10安装ubuntu版wsl
准备php环境
打开ubuntu wsl,进入命令行,安装php环境,并使用sqlite作为数据库
# 首先使用sudo权限
sudo -s
提权到root用户后,修改源配置,并更新源。然后安装需要的软件。
cat > /etc/apt/source.list <<EOF
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF
apt update
apt install -y sqlite apache2 php libapache2-mod-php php-curl php-mbstring php-gd php-sqlite3 unzip
#在d盘下创建共享文件夹,并软链接到/var/www/html目录
mkdir /mnt/d/共享文件夹
rm -rf /var/www/html && ln -s /mnt/d/共享文件夹 /var/www/html
cd /var/www/html/
wget http://static.kodcloud.com/update/download/kodbox.1.12.zip
unzip kodbox.1.12.zip && chmod -Rf 777 ./*
开启webdve功能
默认情况下,可道云不能直接使用WebDAV功能,需要进行一些配置
vim /etc/php/7.4/apache2/php.ini
# 找到<Directory /var/www/>项,进行如下修改
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
AcceptPathInfo On
</Directory>
a2enmod rewrite
cat > /var/www/html/.htaccess <<EOF
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
EOF
chmod -R 777 /var/www/html/.htaccess
最后重启下服务,即可
service apache2 restart
WIN10用户开机启动
按住Windows键
+R
输入shell:startup
后回车键,在打开的文件夹下创建一个文本文件,如:start_storage.txt
wsl -u root service apache2 start
然后修改文件名后缀,最后文件名为start_storage.bat
win10用户端
按住Windows键
+R
输入shell:startup
后回车键,在打开的文件夹下创建一个文本文件,如:mount_storage.txt
@echo off
net use Z: http://127.0.0.1/index.php/plugin/webdav/kodbox/ "password" /user:"admin"
另存为mount_storage.bat