合肥網(wǎng)站建設(shè)推廣百度網(wǎng)站大全舊版
第一臺(tái)虛擬機(jī):安裝 Nginx
更新系統(tǒng)包列表:
sudo apt update
安裝 Nginx及php擴(kuò)展:
sudo apt install nginx php-fpm php-pgsql php-mysqli -y
啟動(dòng) Nginx 服務(wù):
sudo systemctl start nginx
檢查 Nginx 是否正常運(yùn)行:
xdg-open http://localhost
注意:終端命令打開網(wǎng)址
打開瀏覽器,輸入localhost
,如果看到 Nginx 的默認(rèn)歡迎頁(yè)面,說(shuō)明 Nginx 已正確安裝。
第二臺(tái)虛擬機(jī):安裝 PostgreSQL
安裝 PostgreSQL:
sudo apt install postgresql postgresql-contrib -y
配置 PostgreSQL:
-
默認(rèn)情況下,PostgreSQL 使用
postgres
用戶運(yùn)行。 -
你可以通過運(yùn)行
sudo -u postgres psql
來(lái)訪問 PostgreSQL 的命令行界面。sudo -u postgres psql
-
創(chuàng)建數(shù)據(jù)庫(kù)和用戶,設(shè)置權(quán)限。例如:
CREATE DATABASE wordpress_db; CREATE USER wordpress_user WITH PASSWORD 'wordpress123'; GRANT ALL PRIVILEGES ON DATABASE wordpress_db TO wordpress_user; \q