部署ecshop电商平台
·
部署ecshop电商平台
安装nginx
[root@server ~ 09:03:25]# yum install -y nginx
[root@server ~ 09:04:02]# systemctl enable nginx.service --now
[root@server ~ 09:04:05]# echo "Nginx Test Page" > /usr/share/nginx/html/index.html
[root@server ~ 09:04:13]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.1.8.10 server.demo.cloud server
[root@server ~ 09:04:39]# curl http://server.demo.cloud/
Nginx Test Page
安装mariadb
[root@server ~ 09:05:17]# yum install -y mariadb-server
[root@server ~ 09:06:09]# systemctl enable mariadb --now
[root@server ~ 09:06:16]# mysql_secure_installation
安装和准备php
[root@server ~ 09:06:41]# yum install -y php php-fpm
[root@server ~ 09:07:43]# vim /etc/php-fpm.d/www.conf
[root@server ~ 09:08:34]# systemctl enable php-fpm.service --now
[root@server ~ 09:08:49]# vim /etc/nginx/conf.d/vhost-server.demo.cloud.conf
[root@server ~ 09:10:11]# systemctl restart nginx
[root@server ~ 09:10:16]# echo "<?php echo 'PHP Test Page'.\"\n\"; ?>" > /usr/share/nginx/html/test.php
#测试php解析
[root@server ~ 09:10:25]# php /usr/share/nginx/html/test.php
PHP Test Page
[root@server ~ 09:10:36]# curl http://server.demo.cloud/test.php
PHP Test Page
准备数据库
[root@server ~ 09:10:58]# mysql -uroot -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 Server
Copyright (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 ;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE USER ecshop@localhost IDENTIFIED BY '123';
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)]> exit
Bye
准备站点
#下载ecshop组件
[root@server ~ 09:15:09]# yum install -y wget
[root@server ~ 09:15:21]# wget http://192.168.46.88/01.softwares/ECShop_V4.1.20_UTF8.zip
[root@server ~ 09:15:36]# ls
anaconda-ks.cfg ECShop_V4.1.20_UTF8.zip
#解压
[root@server ~ 09:16:13]# unzip ECShop_V4.1.20_UTF8.zip
[root@server ~ 09:16:28]# ls
anaconda-ks.cfg ECShop_V4.1.20_UTF8_release20250416 ECShop_V4.1.20_UTF8.zip
[root@server ~ 09:16:29]# ls /usr/share/nginx/html/
404.html en-US img nginx-logo.png test.php
50x.html icons index.html poweredby.png
[root@server ~ 09:17:02]# mv /usr/share/nginx/html/ /usr/share/nginx/html.ori
#移动到网页目录下
[root@server ~ 09:17:14]# cp -a ECShop_V4.1.20_UTF8_release20250416/source/ecshop/ /usr/share/nginx/html
#递归修改文件权限
[root@server ~ 09:17:44]# chown nginx:nginx -R /usr/share/nginx/html
注意事项
#进入网页提示更改 /var/lib/php/ 权限
[root@server ~ 09:24:44]# chown nginx:nginx -R /var/lib/php/
#重启nginx和php-fpm
[root@server ~ 09:25:41]# systemctl restart nginx.service php-fpm.service
#下载网页要求相关环境包
[root@server ~ 09:25:54]# yum install -y php-gd php-common php-pear php-mbstring php-mcrypt php-mysqlnd
[root@server ~ 09:26:46]# systemctl restart nginx.service php-fpm.service
#数据库用户名和密码要与自己创建的对应
#两次时区登陆
#http://server.demo.cloud/admin 登录管理员页面使用ecshop账户登录
systemctl restart nginx.service php-fpm.service
#数据库用户名和密码要与自己创建的对应
#两次时区登陆
#http://server.demo.cloud/admin 登录管理员页面使用ecshop账户登录
更多推荐




所有评论(0)