致力于提供有竞争力的软件解决方案和服务,德尚网络欢迎您!
技术/产品咨询
技术/产品咨询
    • - 微信扫一扫 -

      QQ:181814630

      电话:15116362044

DSO2O演示
DSMall演示
DS多平台演示
  • DSPlatform(多平台系统)演示地址及账号
    支持普通店铺,外卖店铺,上门家政,上门服务,视频教育等,Thinkphp8.0+uniapp+mysql+Vue3,拓展性强,商户可开多个不同类型店铺,
    演示角色 演示地址 账号 密码
    后台PC端 点击进入 test 123456
    商户PC端(可开多个店铺) 点击进入 seller 123456
    店铺管理PC端 点击进入 seller 123456
    手机端 点击进入 test 123456
    骑手端 点击进入 test 123456
    师傅端 点击进入 test 123456
    短视频 点击进入 test 123456
    DSPlatform(多平台系统)uniapp移动端二维码演示地址
    • 用户端

    • 机构端

DSShop Linux系统基于LNMP单机部署/集群部署

1. 硬件选购

1.1单机部署基本硬件

阿里云域名

阿里云服务器(推荐配置:Centos6.8 64位,双核4G内存 3M带宽)

1.2集群部署基本硬件

阿里云域名

阿里云服务器至少两台 (用于主备服务或流量分发)

阿里云负载均衡 (用于流量分发)

阿里云数据库Redis版(用于存储缓存)

阿里云数据库 Mysql(用于存储数据,建议高可用版,可选是否配置主从数据库)

阿里云OSS图片存储(用于第三方图片存储)

 

2. 环境部署

2.1单机部署

安装Lnmp环境集成包:https://lnmp.org/install.html

wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp

 

 

添加、删除虚拟主机及伪静态管理:https://lnmp.org/faq/lnmp-vhost-add-howto.html

lnmp vhost add  、  lnmp vhost list  、 lnmp vhost del

 

LNMP默认网站配置文件:/usr/local/nginx/conf/nginx.conf

LNMPA默认网站配置文件:/usr/local/nginx/conf/nginx.conf 和 /usr/local/apache/conf/extra/httpd-vhosts.conf

LAMP默认网站配置文件:/usr/local/apache/conf/extra/httpd-vhosts.conf

 

 

 

相关配置:

TP5 需要设置 防跨目录设置:https://lnmp.org/faq/lnmp-vhost-add-howto.html

 

.user.ini文件无法直接修改,如要修或删除需要先执行:chattr -i /网站目录/.user.ini

可以使用winscp文件管理、vim编辑器或nano编辑器进行修改。

删除的话rm -f /网站目录/.user.ini 就可以。

修改完成后再执行:chattr +i /网站目录/.user.ini

.user.ini不需要重启一般5分钟左右生效,也可以重启一下php-fpm立即生效。

如果要更改网站目录必须要按上述方法修改防跨目录的设置,否则肯定报错!!

 

LNMP 1.4上如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 在该行行前添加 # 或删除改行,需要重启nginx。

 

1.

/usr/local/php/etc/php.ini

找到disable_functions 后面的scandir删除掉这个函数。

lnmp restart

 

2.

/usr/local/nginx/conf/vhost/域名.conf/

2.1

include enable-php.conf;

修改为

include enable-php-pathinfo.conf;

 

2.2

新增隐藏index.php

        location / {
          #autoindex  on;
          if (!-e $request_filename){
            rewrite  ^(.*)$  /index.php?s=/$1  last;
          }
        }

 

2.3

网站访问目录指向public  

 

3.设置相关目录权限

chmod -R 777 目录

chmod -R 777 runtime

chmod -R 777 public/uploads

chmod 777 public/install

chmod 777 application

 

 

4.如需要用到Redis 则需要PHP环境安装扩展支持Redis

https://lnmp.org/faq/addons.html

安装

进入lnmp解压后的目录,执行:./addons.sh install redis

 

 

2.2集群部署

Redis缓存

购买阿里云数据库Redis  获取Redis 相关配置信息,修改程序代码配置信息。

 

Application/config.php

配置修改为

 'cache'   => [
        'type'   => 'Redis',
        'host'       => 'r-2ze6a9d0a0af4f34.redis.rds.aliyuncs.com',
        'port'       => 6379,
        'password'   => 123456,
],

 

'session' => [
        'prefix' => 'home',
        'type' => 'redis',
        'auto_start' => true,
        // redis主机
        'host' => 'r-8vb33a2665761634.redis.zhangbei.rds.aliyuncs.com',
        // redis端口
        'port' => 6379,
        // 密码
        'password' => 123456,
],

 

Application/home/config.php

配置修改为

'session' => [
        'prefix' => 'home',
        'type' => 'redis',
        'auto_start' => true,
        // redis主机
        'host' => 'r-8vb33a2665761634.redis.zhangbei.rds.aliyuncs.com',
        // redis端口
        'port' => 6379,
        // 密码
        'password' => 123456,
],

 

 

阿里云OSS第三方图库

后台配置相关信息

 

 

阿里云数据库 Mysql

Application/database.php

 

deploy 参数修改为  1

rw_separate  参数修改为 true

'hostname'    => '192.168.1.1,192.168.1.2', (后接数据库地址)

 

 

阿里云负载均衡

做好相关服务配置即可。