Nginx+kodexplorer(可道云部署纪要)

Nginx+kodexplorer(可道云部署纪要)

安装nginx

yum install yum-utils
To set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

yum-config-manager --enable nginx-mainline

yum install nginx


systemctl status nginx
systemctl start nginx
systemctl enable nginx

防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service

SElinux关闭

临时关闭:
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
永久关闭:
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
#重启服务reboot

php安装

[root@localhost conf.d]# yum -y install php-fpm php-mbstring php-gd
[root@localhost conf.d]# systemctl status  php-fpm
[root@localhost conf.d]# systemctl restart  php-fpm
[root@localhost conf.d]# systemctl enable  php-fpm

下载kodexplorer

wget http://static.kodcloud.com/update/download/kodexplorer4.39.zip

解压到/data/kodexplorer目录下(自定义目录,本文在/data/kodexplorer)

cd /data/kodexplorer
unzip kodexplorer4.39.zip

nginx配置

server {
    listen 80;
    server_name localhost;
    root /data/kodexplorer/;
    index  index.html index.htm index.php;

        location ~ \.php$ {
                root kodexplorer;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param SCRIPT_FILENAME /data/kodexplorer$fastcgi_script_name;
                include fastcgi_params;
        }
 }

新增加php配置

vim /etc/php.ini
#在最后一行
extension=mbstring.so
extension=php_gd2.dll
:wq!
#保存退出即可
#重启php-fpm服务
systemctl restart php-fpm

遇到的问题:

1、php的index.html无法访问,SElinux没有关闭导致;

2、是由于php-mbstring php-gd没有安装,并且php.ini没有添加配置(如上<新增加php配置>),图片无法加载‘

3、nginx无法访问到,是由于nginx配置不对,如下修改:

#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /data/kodexplorer$fastcgi_script_name;
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值