项目实战:ecshop
文章目录
- 项目实战:ecshop
- ecshop 介绍
- ecshop 安装
- 准备 LNMP 环境
- 准备数据库
- 准备 ecshop 站点
- 配置过程
项目实战:ecshop
ecshop 介绍
官网
ECShop多场景在线商城。
ecshop 安装
准备 LNMP 环境
[root@server ~ 09:16:17]# yum install -y nginx
[root@server ~ 09:16:57]# systemctl enable nginx --now
[root@server ~ 17:21:11]# yum install -y mariadb-server
[root@server ~ 17:21:41]# systemctl enable mariadb --now
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@server ~ 17:21:46]# mysql_secure_installation
准备数据库
[root@server ~ 17:22:47]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.68-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE ecshop;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> CREATE USER ecshop@localhost IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> GRANT ALL PRIVILEGES ON ecshop.* TO ecshop@localhost;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> quit
Bye
准备 ecshop 站点
准备 ecshop 站点配置文件。
[root@server ~ 17:24:32]# vim /etc/nginx/conf.d/www.server.cloud-ssl.conf
server {listen 443 ssl http2;listen [::]:443 ssl http2;server_name _;root /usr/share/nginx/html;
#添加访问首页为index.php index index.php;ssl_certificate "/etc/ssl/certs/www.server.cloud/www.crt";
...}
}[root@server ~ 17:25:48]# systemctl restart nginx
[root@server ~ 17:27:02]# mv /usr/share/nginx/html/ /usr/share/nginx/html.ori# 准备 ecshop 站点数据文件,这里使用 ECShop_V4.1.20 版本。
[root@server ~ 17:27:06]# unzip ECShop_V4.1.20_UTF8.zip
[root@server ~ 17:27:08]# cp -a ECShop_V4.1.20_UTF8_release20250416/source/ecshop /usr/share/nginx/html
[root@server ~ 17:27:13]# chown nginx:nginx -R /usr/share/nginx/html
[root@server ~ 17:27:18]# yum install -y php-gd php-common php-pear php-mbstring php-mcrypt
[root@server ~ 17:28:31]# vim /etc/php-fpm.d/www.conf
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
[root@server ~ 17:29:59]# chown nginx:nginx -R /var/lib/php/
[root@server ~ 17:30:35]# systemctl restart nginx.service php-fpm.service
配置过程
客户端登录 https://www.server.cloud
estart nginx.service php-fpm.service
#### 配置过程客户端登录 https://www.server.cloud