其他分享
首页 > 其他分享> > 利用LNMP实现可道云私有云

利用LNMP实现可道云私有云

作者:互联网

官网:http://kodcloud.com/

1、准备MySQL数据库

 
[root@cent8_yzl_20 ~]# yum install -y mysql-server
[root@cent8_yzl_20 ~]# systemctl enable --now mysqld
[root@cent8_yzl_20 ~]# mysql
mysql> create database kodbox;
mysql> create user kodbox@'10.0.0.%' identified by 'redhat';
mysql> grant all on kodbox.* to kodbox@'10.0.0.%';

2、准备Redis服务

[root@cent8_yzl_20 ~]# yum -y install redis
[root@cent8_yzl_20 ~]# sed -i '/^bind /c bind 0.0.0.0' /etc/redis.conf 
[root@cent8_yzl_20 ~]# grep '^bind' /etc/redis.conf 
bind 0.0.0.0   #修改此行
[root@cent8_yzl_20 ~]# systemctl enable --now redis

3、准备nginx服务

#配置nginx仓库
[root@cent8_yzl_10 ~]# vi /etc/yum.repos.d/nginx.repo
[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
module_hotfixes=true
[root@cent8_yzl_10 ~]# yum install -y nginx
[root@cent8_yzl_10 ~]# mkdir -pv /data/html
[root@cent8_yzl_10 ~]# vi /etc/nginx/conf.d/kod.conf
[root@cent8_yzl_10 ~]# cat /etc/nginx/conf.d/kod.conf 
server {
  listen 80;
  server_name cloud.yzl.org;
  root /data/html;
  location / {
      index index.php index.html;
  }
  location ~ \.php$ {
     fastcgi_pass 127.0.0.1:9000;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
  }
}
[root@cent8_yzl_10 ~]# systemctl enable --now nginx

4、安装和配置php支持redis

[root@cent8_yzl_10 ~]# yum install -y https://mirror.tuna.tsinghua.edu.cn/remi/enterprise/remi-release-8.rpm

#安装必要的包
[root@cent8_yzl_10 ~]# yum install -y php74-php-fpm php74-php-mysqlnd php74-php-pecl-redis5 php74-php-mbstring php74-php-xml php74-php-gd

[root@cent8_yzl_10 ~]# vi /etc/opt/remi/php74/php-fpm.d/www.conf 
user = nginx
group = nginx

#文件最后修改
;php_value[session.save_handler] = files
;php_value[session.save_path]    = /var/opt/remi/php74/lib/php/session
php_value[soap.wsdl_cache_dir]  = /var/opt/remi/php74/lib/php/wsdlcache
;php_value[opcache.file_cache]  = /var/opt/remi/php74/lib/php/opcache
php_value[session.save_handler] = redis
php_value[session.save_path] = "tcp://10.0.0.20:6379"

5、准备可道云程序

[root@cent8_yzl_10 ~]# wget https://static.kodcloud.com/update/download/kodbox.1.20.zip
[root@cent8_yzl_10 ~]# ls
anaconda-ks.cfg  kodbox.1.20.zip
[root@cent8_yzl_10 ~]# unzip kodbox.1.20.zip -d /data/html
[root@cent8_yzl_10 ~]# chown -R nginx.nginx /data/html

6、初始化和登录可道云

网站访问cloub.yzl.org

标签:10,cent8,私有,可道,LNMP,nginx,root,php,yzl
来源: https://blog.csdn.net/y_zilong/article/details/117997047