[](#微擎運作環境搭建 "微擎運作環境搭建")微擎運作環境搭建
LAMP 環境昨天已搭建,今日可繼續使用
PHP 環境需要增加
php7.4-curl php7.4-zip
今日用到 MySQL,安裝方式:
apt install mysql-server-8.0
,安裝後預設 root 密碼為空
先執行資料庫初始化:
mysql\_secure\_installation

Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: # 回車
Please set the password for root here.
New password: # 輸入新密碼
Re-enter new password: # 确認新密碼
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y # 移除匿名使用者
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y # 禁用root遠端登入
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y # 移除test資料庫
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y # 重新整理權限
登入連接配接 mysql:
mysql -uroot -p
然後建立一個新的資料庫
建立一個新使用者:(這裡一定要建立一個新使用者,此版本的 mysql 中 root 使用者無法通過 php 連接配接,會因權限問題而拒絕)
create user 'demo'@'localhost' identified by 'admin123';
grant all privileges on newdb.\* to 'demo'@'localhost';
flush privileges;
[](#微擎安裝 "微擎安裝")微擎安裝
下載下傳位址:
線上安裝:
https://cdn.w7.cc/download/WeEngine-Laster-Online.zipcd /var/www
wget https://cdn.w7.cc/download/WeEngine-Laster-Online.zip
rm -rf html/\*
unzip WeEngine-Laster-Online.zip -d html/
cd weengine
mkdir data # 這裡一定要建立一個data檔案夾,否則會報500錯誤碼
chown -R www-data.www-data /var/www/html
經過一個多小時的折騰,發現這個微擎必須用 80 端口,配置虛拟主機使用其他端口時均會在安裝時報無法通路外網的錯誤。
[](#執行安裝 "執行安裝")執行安裝
通路伺服器公網 IP/install.php
注冊然後登入賬号
配置資料庫:
等待下載下傳安裝
執行更新:
[](#連接配接公衆号 "連接配接公衆号")連接配接公衆号
這裡因為我的賬号已綁定了小程式,無法進行下面的實驗
在平台管理 - 添加平台處添加公衆号:
手動添加,填寫相應資訊即可:
-
- *