sd-aws sdonaws 592047561@qq.com + aa2233zz!! IP: 18.217.214.174 Ubuntu Server 20.04 LTS (HVM), SSD Volume Type-> t2.micro->添加存储30G 更新系统并安装必要的软件包 sudo apt-get update && sudo apt-get -y upgrade sudo apt-get -y install curl nano git sudo apt install unzip sudo apt install joe 安装Apache sudo apt-get install apache2 sudo systemctl restart apache2 安装PHP/PHP-FPM sudo apt install php7.4-cli sudo apt-get install php7.4-gd php -v ->PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:47) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies 安装配置mysql sudo apt-get install mysql-server mysql ->Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.22-0ubuntu0.20.04.3 (Ubuntu) mysql_secure_installation ->root + frevres88 创建数据库设置单独的MySQL用户帐户 mysql -u root -p CREATE DATABASE ocwork CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER 'ocwork'@'localhost' IDENTIFIED BY 'Frevres88!'; GRANT ALL PRIVILEGES ON *.* TO 'ocwork'@'localhost' WITH GRANT OPTION; CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'Frevres88!'; GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION; flush privileges; select user,host from mysql.user; 安装phpmyadmin sudo apt-get install php-mbstring x-sudo apt-get install php-gettext sudo apt-get install phpmyadmin sudo ln -s /usr/share/phpmyadmin /var/www/html 18.217.214.174/phpmyadmin --> root密碼太差 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements SHOW VARIABLES LIKE 'validate_password%'; set global validate_password.policy=LOW; ALTER user 'root'@'localhost' IDENTIFIED BY 'frevres88'; --> 下載opencart-3.0.3.6.zip cd /var/www/bk-zip/ wget 118.163.15.73/byu/oc.zip 安装opencart-3.0.3.6 cd /var/www/html/wg1 unzip -q /var/www/bk-zip/oc.zip cd upload mv config-dist.php config.php mv admin/config-dist.php admin/config.php chmod 777 system/storage/cache/ chmod 777 system/storage/download/ chmod 777 system/storage/logs/ chmod 777 system/storage/modification/ chmod 777 system/storage/session/ chmod 777 system/storage/upload/ chmod 777 system/storage/vendor/ chmod 777 image/ chmod 777 image/cache/ chmod 777 image/catalog/ chmod 777 config.php chmod 777 admin/config.php http://18.217.214.174/wg1/index.php http://18.217.214.174/wg1/install/index.php?route=install/step_3->手工 http://18.217.214.174/wg1/install/index.php?route=install/step_4 --- 20210119 AWS sdonaws 新account ========================================================================================================================= root@ip-172-31-40-85:/# df -h Filesystem Size Used Avail Use% Mounted on udev 488M 0 488M 0% /dev tmpfs 100M 11M 89M 11% /run /dev/xvda1 30G 20G 10G 66% / tmpfs 496M 0 496M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 496M 0 496M 0% /sys/fs/cgroup /dev/loop2 18M 18M 0 100% /snap/amazon-ssm-agent/1566 /dev/loop1 29M 29M 0 100% /snap/amazon-ssm-agent/2012 /dev/loop4 97M 97M 0 100% /snap/core/9665 /dev/loop0 97M 97M 0 100% /snap/core/9804 tmpfs 100M 0 100M 0% /run/user/1000 --- 20200825 AWS-QT ADA 備份下載 ========================================================================================================================= 後台打開設定 STORES->Configuration->GENERAL->Reports->General Options->Enable Reports->Yes 清空舊的表 customer_visitor->訪客記錄 report_event->訪問記錄 report_viewed_product_index->訪問產品 (20200502 16:00) mysqldump -u root -prevres88 --databases magento2 > /var/www/bk-gz/magento2_234_8pm_20200502_1600_ok.sql (20200503 10:51) TRUNCATE sales_bestsellers_aggregated_monthly; SELECT * FROM sales_order_item WHERE created_at < '2020-03-20'; DELETE FROM sales_order_item WHERE created_at < '2020-03-20'; (共 54 行) Bestsellers->You refreshed lifetime statistics. --- 20200502 AWS-QT most viewed product report 沒有生效 + 新增 Packing Material + 清舊表成功 ========================================================================================================================= cd /var/www/magento2/app/design/frontend/Lee cp pwc b4u -r joe b4u/registration.php-> 'frontend/Lee/b4u', joe b4u/theme.xml->
(82 + 128 records) SELECT * FROM products_description WHERE products_description LIKE '%
%' UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%'; UPDATE products_description SET products_description=REPLACE(products_description,'
','') WHERE products_description LIKE '%
%'; 11.) 去除