Ubuntu+Nginx+PHP7+KodExplorer

安装Nginx

1
sudo apt-get install nginx

测试服务

1
/etc/init.d/nginx start

访问本地地址:http: //localhost/

安装php

1
sudo apt-get install php

配置Nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html; #添加一个index.php

server_name 192.168.100.100; #添加站点地址

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

测试,在/var/www/html目录下创建文件info.php
添加以下内容

1
2
3
<?php
phpinfo();
?>

访问http: //192.168.100.100/info.php是否能够看到php信息

KodExplorer下载及使用

下载地址:可道云
解压后放到linux上,我这里是放在默认目录下:/var/www/html/

1
2
3
4
5
6
7
8
9
10
11
zxw@ubuntu:/var/www/html$ ls -l
总用量 112
drwxr-xr-x 10 root root 4096 4月 18 17:25 app
-rw-r--r-- 1 root root 76552 4月 18 17:25 ChangeLog.md
drwxr-xr-x 3 root root 4096 4月 18 17:25 config
drwxr-xr-x 7 root root 4096 4月 18 17:25 data
-rw-r--r-- 1 root root 612 4月 18 17:15 index.nginx-debian.html
-rw-r--r-- 1 root root 118 4月 18 17:25 index.php
drwxr-xr-x 13 root root 4096 4月 18 17:25 plugins
-rw-r--r-- 1 root root 7753 4月 18 17:25 README.MD
drwxr-xr-x 6 root root 4096 4月 18 17:25 static

修改权限777

1
sudo chmod -R 777 /var/www/html/

安装运行需要的php库

1
2
3
sudo apt-get install php-curl
sudo apt-get install php-mbstring
sudo apt-get install php-gd

安装KodExplorer
访问http://192.168.100.100/


设置admin密码后登陆,请尽情的使用吧



问题解决

与wordpress搭配一起使用时,可道云在站点的二级目录下
data目录迁移后如可能会发生写入session会话错误
迁移方式查看站点目录下的config目录中的config.php里的注释说明
则将config.php中的session路径写死在站点目录下,不再将data目录中的session迁移出去


1
define('KOD_SESSION',   'data/session/');     //session目录