- 檢查系統(tǒng)是否已經(jīng)安裝了Apache HTTP Server,即httpd
如果返回如下內(nèi)容,說明已經(jīng)安裝
[root@localhost ~]# httpd -version
Server version: Apache/2.4.6 (CentOS)
Server built: Aug 8 2019 11:41:18
如果沒有安裝,執(zhí)行下面命令安裝和啟動(dòng)服務(wù)
[root@localhost ~]# yum install httpd -y
- 檢查系統(tǒng)是否已經(jīng)安裝了PHP和插件
如果返回如下內(nèi)容,說明已經(jīng)安裝PHP
[root@localhost ~]# php -v
PHP 5.4.16 (cli) (built: Nov 1 2019 16:04:20)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@localhost ~]# rpm -qa | grep php-gd
php-gd-5.4.16-46.1.el7_7.x86_64
[root@localhost ~]# rpm -qa|grep php-mysql
php-mysql-5.4.16-46.1.el7_7.x86_64
如果沒有安裝,執(zhí)行下面命令安裝
[root@localhost ~]# yum install php php-gd php-mysql -y
- 檢查系統(tǒng)是否已經(jīng)安裝了MySQL或MariaDB
如果返回如下內(nèi)容,說明已經(jīng)安裝MariaDB
[root@localhost ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.64-1.el7.x86_64
mariadb-5.5.64-1.el7.x86_64
mariadb-server-5.5.64-1.el7.x86_64
如果沒有安裝,執(zhí)行下面命令安裝和配置,按照提示輸入root用戶新密碼
[root@localhost ~]# yum install mariadb-server -y
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl status mariadb
[root@localhost ~]# mysql_secure_installation
- 修改PHP配置文件設(shè)置時(shí)區(qū)
搜索timezone,把date.timezone前的注釋符#去掉,值設(shè)為PRC
[root@localhost ~]# vim /etc/php.ini
date.timezone = PRC
- 下載,解壓ECShop 3.6源碼
[root@localhost ~]# wget http://zj.mycodes.net/201708/ECShop_3.6.0_UTF8_release.zip
[root@localhost ~]# unzip ECShop_3.6.0_UTF8_release.zip
[root@localhost ~]# mv ECShop_3.6.0_UTF8_release/source/* /var/www/html/
- 設(shè)置源碼目錄可寫
[root@localhost ~]# mv ECShop_3.6.0_UTF8_release/source/* /var/www/html/
[root@localhost ~]# cd /var/www/html
[root@localhost ~]# ls
appserver ecshop
[root@localhost ~]# chmod 777 -R appserver ecshop
- 關(guān)閉selinux
修改selinux的配置文件,把SELINUX的值改為disabled
[root@localhost conf]# vim /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
[root@localhost conf]# setenforce 0
setenforce: SELinux is disabled
- 啟動(dòng)Apache服務(wù),查詢服務(wù)狀態(tài)并設(shè)置開機(jī)啟動(dòng)服務(wù)
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# systemctl status httpd
- 防火墻允許Apache服務(wù)的80端口
[root@localhost conf]# firewall-cmd --add-port=80/tcp --zone=public --permanent
success
[root@localhost conf]# firewall-cmd --reload
success
- 瀏覽器安裝ECShop
假設(shè)服務(wù)器的IP地址是192.168.8.128,瀏覽器地址欄輸入
http://192.168.8.128/ecshop/install/index.php
根據(jù)安裝向?qū)Р襟E,同意協(xié)議,檢查環(huán)境
ECShop安裝 同意協(xié)議
ECShop安裝 檢查環(huán)境
配置系統(tǒng)時(shí)輸入數(shù)據(jù)庫root用戶密碼,數(shù)據(jù)庫名ecshop,輸入管理員賬號(hào)和密碼,勾選安裝測試數(shù)據(jù),點(diǎn)擊立即安裝
ECShop安裝 配置系統(tǒng)
安裝完成后不需要激活系統(tǒng),瀏覽器輸入首頁地址訪問
http://192.168.8.128/ecshop/index.php