当前位置: 首页 > news >正文

LNMP-电商平台-ECshop实战

项目实战:LNMP-电商平台-ECshop

一、ECshop 介绍

ECShop 多场景在线商城。

二、部署前置规划

使用centos7模板克隆一台server

节点规划

节点名称节点 IP节点功能
ecshop10.1.8.10/24LNMP

三、搭建 LNMP 运行环境

3.1 安装配置 Nginx

# 配置阿里epel源[root@ecshop ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo# 安装nginx并开机自启[root@ecshop ~]# yum install -y nginx[root@ecshop ~]# systemctl enable nginx.service --now# 写入测试首页[root@ecshop ~]# echo "Nginx Test Page" > /usr/share/nginx/html/index.html

3.2安装初始化 Mariadb

[root@ecshop ~]# yum install -y mariadb-server[root@ecshop ~]# systemctl enable mariadb --now[root@server ~]# mysql_secure_installationNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE!PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): # 【初次】 直接回车(默认无密码) OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] y 输入 y → 设置 root 密码 New password: #你要设置的密码,如huawei Re-enter new password: #再次输入密码 Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y # 删除匿名用户(安全) ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] n # 禁止远程登录root? (项目常用选 n; 安全服务器选 y) ... skipping. By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y # 删除 test 测试库 Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y # 刷新权限 ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanksforusing MariaDB!

3.3 安装配置 PHP & php-fpm

[root@ecshop ~]# yum install -y php php-fpm[root@ecshop ~]# vim /etc/php-fpm.d/www.conf# 修改两行参数# user = apacheuser=nginx# group = apachegroup=nginx[root@ecshop ~]# systemctl enable php-fpm.service --now[root@ecshop ~]# vim /etc/nginx/conf.d/vhost-shop.laogao.cloud.confserver{listen80;listen[::]:80;server_name shop.laogao.cloud;root /usr/share/nginx/html;# 设置默认主页index index.php;# 设置php页面处理方式location ~\.php${try_files$uri=404;fastcgi_pass127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;include fastcgi_params;}}[root@ecshop ~]# systemctl restart nginx# 写入php测试文件[root@ecshop ~]# echo "<?php echo 'PHP Test Page'.\"\n\"; ?>" > /usr/share/nginx/html/test.php

客户端测试

四、创建 ECshop 专用数据库与账号

[root@ecshop ~]# mysql -u root -phuaweiCREATE DATABASE ecshop;CREATEUSERecshop@localhost IDENTIFIED BY'huawei';GRANT ALL PRIVILEGES ON ecshop.* TO ecshop@localhost;FLUSH PRIVILEGES;exit

五、部署 ECshop 商城源码

使用版本:ECShop_V4.1.20

# 上传源码包至root家目录并解压[root@ecshop ~]# unzip ECShop_V4.1.20_UTF8.zip# 备份默认页面目录[root@ecshop ~]# mv /usr/share/nginx/html/ /usr/share/nginx/html.ori# 复制商城源码到网站根目录[root@ecshop ~]# cp -a ECShop_V4.1.20_UTF8_release20250416/source/ecshop /usr/share/nginx/html# 修改目录归属nginx用户[root@ecshop ~]# chown nginx:nginx -R /usr/share/nginx/html# 安装ECshop依赖PHP扩展[root@ecshop ~]# yum install -y php-gd php-common php-pear php-mbstring php-mcrypt php-mysqlnd# 修改php会话目录权限[root@ecshop ~]# chown nginx:nginx -R /var/lib/php/# 重启服务生效[root@ecshop ~]# systemctl restart nginx php-fpm

windows里C:\Windows\System32\drivers\etc\hosts配置域名解析 10.1.8.10 shop.laogao.cloud

六、Web 端可视化安装 ECshop

访问地址:http://shop.laogao.cloud



激活系统,享受更多服务。不激活也可以使用。关闭网页。

七、ECshop 站点访问

商城首页
http://shop.laogao.cloud

商城管理后台
http://shop.laogao.cloud/admin

http://www.jsqmd.com/news/1397207/

相关文章:

  • Canal数据库增量日志解析:从原理到生产环境部署与调优
  • 动态规划实战:01背包如何求解数字组合方案数
  • 苏州黄金回收正规变现渠道,黄金变现秒到无拖延 - 资讯早知道
  • 2026最新降AI教程|可直接复制英文降AI指令(附3款英文降AIGC工具实测)
  • 2026贺州BBA豪车维修行业解析:车主痛点与门店优选攻略 - 收录优先
  • 10.vue指令6
  • 数学建模竞赛实战指南:从APMCM获奖案例解析团队协作与建模全流程
  • AIGC检测不过保姆级教程!5款工具从试用到复检完整操作! - 我要发一区
  • 英语阅读_As morning exercises started
  • Go项目数据库迁移实战:从手动SQL到golang-migrate自动化
  • UCIe基础学习1:chiplet 与 UCIe——为什么 die-to-die 互联成为必然
  • 华硕笔记本轻量控制工具 G-Helper:换掉 Armoury Crate 之后还剩多少功能?
  • 前端开发者必懂:TCP与UDP核心原理与实战场景解析
  • 2026上海本地PPT设计公司精选:商业演示定制指南 - 谁都没有我好看
  • League Akari 完整极速上手指南:基于 LCU API 的英雄联盟客户端一站式工具箱
  • AI编程革命:从Copilot到Devin,程序员如何应对“去代码化”未来
  • 什么是实时数据集成?和传统同步有何不同?哪些场景真需要?一篇看懂
  • JetBrains 试用期重置完整指南:用 ide-eval-resetter 找回 30 天免费评估
  • 拉萨奇荐新旧货市场:二手家具家电及商用设备一站式购销回收平台 - 收录优先
  • 企业AI应用开发:腾讯云ADP与开源OpenClaw选型与实战指南
  • 数学建模国赛C题解题框架:从破题到论文的完整实战指南
  • 2026合肥本土考公机构推荐:研趣公考无忧登科班成在校生备考** - 大学规划师
  • Uncensored AI技术解析:本地部署、安全机制与工程伦理实践
  • 从零配置Codex:手把手教你接入AI编程助手,提升开发效率
  • ADB实现微信降级:无需Root的完整操作指南
  • 维性力网:灵魂三问的全域螺旋拓扑解答040
  • APMCM数学建模竞赛实战指南:从组队到论文的72小时科研训练
  • 2026年,为何成都人配高度数眼镜都首选这家?背后原因大揭秘! - 企业推荐官
  • CMP浆料管理:颗粒团聚导致的划伤
  • Git多身份管理:为不同仓库配置独立用户名与邮箱的完整指南