1.安装运行环境

复制下面在SSH里执行:

opkg update
opkg install php7 php7-mod-session php7-cgi php7-mod-ctype php7-mod-hash php7-mod-pdo php7-mod-json php7-mod-curl php7-mod-mbstring php7-mod-ldap php7-mod-gd php7-mod-pdo php7-mod-xml php7-mod-iconv unzip

2.可道云下载

手动下载地址:https://kodcloud.com/download
或者用SSH安装命令(/mnt/sdb1根据挂载盘路径进行更改):

dir="/mnt/sda1"
mkdir -p $dir/www
mkdir -p $dir/tmp
cd $dir/www
wget http://static.kodcloud.com/update/download/kodexplorer4.40.zip
unzip kodexplorer4.40.zip

3.php配置

更改/etc/php.ini文件内容如下:

[PHP]
zend.ze1_compatibility_mode = Off
engine = On
short_open_tag = On
precision    =  12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 100
open_basedir = /mnt/sda1/:/tmp/:/proc/
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 30    ; Maximum execution time of each script, in seconds.
max_input_time = 60    ; Maximum amount of time each script may spend parsing request data.
memory_limit = 20M    ; Maximum amount of memory a script may consume.
error_reporting  =  E_ALL & ~E_NOTICE & ~E_STRICT
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
request_order = "GP"
register_globals = Off
register_long_arrays = Off
register_argc_argv = On
auto_globals_jit = On
post_max_size = 8M
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root = 
user_dir =
extension_dir = "/usr/lib/php"
enable_dl = On
cgi.force_redirect = 0
file_uploads = On
upload_tmp_dir = "/mnt/sdb1/tmp"
upload_max_filesize = 20000M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60

以上挂载盘路径是/mnt/sda1
更改请用专业编辑工具进行替换
替换/mnt/sda1为你的挂载盘路径

4.uHTTPd配置

(如果没有安装uHTTPd,请自行百度安装)
位置/etc/config
找到uhttpd并打开
在最后面添加

config uhttpd 'web'
list listen_http '0.0.0.0:81'
option home '/mnt/sda1/www'
option tcp_keepalive '1'
list index_page 'index.php'
list index_page 'index.html'
list index_page 'index.htm'
option rfc1918_filter '0'
option redirect_https '0'
list interpreter '.php=/usr/bin/php-cgi'
list interpreter '.cgi=/usr/bin/perl'

以上
list listen_http '0.0.0.0:81'的81是端口
option home '/mnt/sda1/www'的/mnt/sda1/www是挂载盘可道云路径
在服务-uHTTPd里也可以自己更改,不过不要改MAIN这一项,要不然你就访问不了路由界面了
uHTTPd文件我已附带,也可以直接上传到/etc/config文件夹里

5.重启服务

/etc/init.d/uhttpd restart
/etc/init.d/php7-fastcgi restart

6.进入可道云

地址:http://路由IP:端口
没公网IP的尝试内网穿透吧

优化设置:http://doc.kodcloud.com/#/others/options
其他参考教程:https://blog.csdn.net/qiaoshuo/article/details/88396335
openwrt软件包:http://downloads.openwrt.org/releases/19.07-SNAPSHOT/packages/arm_cortex-a9_vfpv3/packages/

文章目录