LNMP-电商平台-ECshop实战
项目实战:LNMP-电商平台-ECshop一、ECshop 介绍ECShop 多场景在线商城。二、部署前置规划使用centos7模板克隆一台server节点规划节点名称节点 IP节点功能ecshop10.1.8.10/24LNMP三、搭建 LNMP 运行环境3.1 安装配置 Nginx# 配置阿里epel源[rootecshop ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo# 安装nginx并开机自启[rootecshop ~]# yum install -y nginx[rootecshop ~]# systemctl enable nginx.service --now# 写入测试首页[rootecshop ~]# echo Nginx Test Page /usr/share/nginx/html/index.html3.2安装初始化 Mariadb[rootecshop ~]# yum install -y mariadb-server[rootecshop ~]# systemctl enable mariadb --now[rootserver ~]# 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, well need the current password for the root user. If youve just installed MariaDB, and you havent 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 youve completed all of the above steps, your MariaDB installation should now be secure. Thanksforusing MariaDB!3.3 安装配置 PHP php-fpm[rootecshop ~]# yum install -y php php-fpm[rootecshop ~]# vim /etc/php-fpm.d/www.conf# 修改两行参数# user apacheusernginx# group apachegroupnginx[rootecshop ~]# systemctl enable php-fpm.service --now[rootecshop ~]# 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$uri404;fastcgi_pass127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;include fastcgi_params;}}[rootecshop ~]# systemctl restart nginx# 写入php测试文件[rootecshop ~]# echo ?php echo PHP Test Page.\\n\; ? /usr/share/nginx/html/test.php客户端测试四、创建 ECshop 专用数据库与账号[rootecshop ~]# mysql -u root -phuaweiCREATE DATABASE ecshop;CREATEUSERecshoplocalhost IDENTIFIED BYhuawei;GRANT ALL PRIVILEGES ON ecshop.* TO ecshoplocalhost;FLUSH PRIVILEGES;exit五、部署 ECshop 商城源码使用版本ECShop_V4.1.20# 上传源码包至root家目录并解压[rootecshop ~]# unzip ECShop_V4.1.20_UTF8.zip# 备份默认页面目录[rootecshop ~]# mv /usr/share/nginx/html/ /usr/share/nginx/html.ori# 复制商城源码到网站根目录[rootecshop ~]# cp -a ECShop_V4.1.20_UTF8_release20250416/source/ecshop /usr/share/nginx/html# 修改目录归属nginx用户[rootecshop ~]# chown nginx:nginx -R /usr/share/nginx/html# 安装ECshop依赖PHP扩展[rootecshop ~]# yum install -y php-gd php-common php-pear php-mbstring php-mcrypt php-mysqlnd# 修改php会话目录权限[rootecshop ~]# chown nginx:nginx -R /var/lib/php/# 重启服务生效[rootecshop ~]# systemctl restart nginx php-fpmwindows里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

相关新闻

HCIA - Al Solution 华为认证—— 3、大模型基础

HCIA - Al Solution 华为认证—— 3、大模型基础

目录 一、人工智能发展势与概 1. BERT概述及架构 1)BERT概述 2)BERT的结构 3)输入部分的处理 4)输出部分的处理 5)Fine-tuning阶段 6)模型效果 2. GPT概述及架构 1)模型效果及产生背景 2)GPT的发展历程 3)GPT系列的共同特性 4)GPT系列的模型参数对比 5…

2026/11/4 3:56:24 阅读更多 →
西门子S7-200 SMART PLC基本指令详解:从位逻辑到程序控制

西门子S7-200 SMART PLC基本指令详解:从位逻辑到程序控制

1. 从“开关”到“逻辑”:为什么基本指令是PLC编程的基石 如果你刚接触西门子S7-200 SMART PLC,面对编程软件里那一堆指令图标,可能会有点懵。很多人会急着去学复杂的通信、运动控制,但我的经验是, 所有高级应用都建立…

2026/11/3 6:28:49 阅读更多 →
2026年工程项目管理系统推荐:从施工到交付的全流程选型指南

2026年工程项目管理系统推荐:从施工到交付的全流程选型指南

数据来源:本文基于公开市场信息、行业研究报告及厂商公开资料整理,信息更新至 2026 年 7 月。排名不分先后,仅供参考决策。一、行业痛点:大建设时代收官,精细化管控如何 “补课”?中国基础设施建设正从 “大…

2026/11/3 13:44:48 阅读更多 →

最新新闻

Electron桌面应用开发实战:从环境搭建到打包发布全流程

Electron桌面应用开发实战:从环境搭建到打包发布全流程

做前端这些年,我大部分时间都在跟浏览器标签页打交道,直到第一次把桌面应用跑起来,才发现原来自己一直被限制在地址栏和刷新按钮围起来的框框里。Electron这个词,最开始是在某段时间频繁出现在同事的讨论里,一个用HTML…

2026/11/5 12:28:00 阅读更多 →
滑盖智能锁T109深度解析:结构原理、安装调试与故障排查

滑盖智能锁T109深度解析:结构原理、安装调试与故障排查

简介:亚太天能T109滑盖智能锁产品说明书是一份PDF格式的官方技术文档,主要面向智能锁安装人员、终端用户及售后维护者,帮助快速掌握产品安装、配置与常见故障处理。全包仅1个PDF文件,大小4.37MB,内容结构清晰&#xff…

2026/11/5 1:08:50 阅读更多 →
PMSM弱磁控制原理与Simulink建模:高速AGV驱动系统设计指南

PMSM弱磁控制原理与Simulink建模:高速AGV驱动系统设计指南

上个月我在调试一台高速AGV的驱动系统,整车要求空载跑到8m/s,电机转速已经拉到额定点,驱动器的输出电压也顶到了母线电压极限附近。再往上踩速度指令,转速纹丝不动,三相电流反而开始震荡。那会儿我的第一反应就是&…

2026/11/5 12:28:01 阅读更多 →
C++核心知识点:从内存管理到STL的实战指南

C++核心知识点:从内存管理到STL的实战指南

C 这门语言我前前后后折腾了十几年,用它写过嵌入式驱动、做过游戏服务端,也搭过基础组件库。每次看到新人一头扎进"C 核心知识点"这个搜索词,我其实挺感慨的——这门语言的难点从来不是语法多,而是知识点之间的耦合太深…

2026/11/5 12:28:02 阅读更多 →
T109滑盖智能锁怎么装?安装调试与故障排查全攻略

T109滑盖智能锁怎么装?安装调试与故障排查全攻略

简介:亚太天能T109滑盖智能锁产品说明书以PDF格式发布,适合智能锁用户、安装人员与售后维修人员阅读。内容围绕T109系列指纹密码刷卡锁展开,先介绍前面板、后面板、锁体、机械钥匙、电池盒盖等部件名称与功能,再给出完整安装步骤&…

2026/11/5 0:54:28 阅读更多 →
LLM知识降熵:从信息垄断到理解权下放

LLM知识降熵:从信息垄断到理解权下放

你有没有过这种经历:翻开源码注释、论文摘要或者一份专业报告,每个字都认识,连在一起却像天书。想找人聊聊,身边要么没人懂,要么懂的懒得跟你解释。后来我试着把同一段内容丢给一个大语言模型,几秒钟之后&a…

2026/11/5 19:38:59 阅读更多 →

日新闻

周新闻

月新闻