差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:pve-ct-centos8-php-nginx-mariadb [2020/12/06 08:35] – jonathan | tech:pve-ct-centos8-php-nginx-mariadb [2020/12/06 12:01] (目前版本) – jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 建立 PVE CT-CentOS8 + php7.3 + nginx + MariaDB 樣板 ====== | ||
+ | * 建立環境 : | ||
+ | * PVE 6.3-2 | ||
+ | * Cores 1 / Memory 512MB / Swap 512MB / Root Disk 8G | ||
+ | * CentOS 8 Template - centos-8-default_20191016_amd64.tar.xz | ||
+ | * 建立 CT 之後, 先進行 [[tech/ | ||
+ | * 重新開機後登入進行安裝 php7.3 + nginx + MariaDB <cli> | ||
+ | dnf -y install epel-release | ||
+ | dnf module reset php | ||
+ | dnf module enable php:7.3 | ||
+ | dnf install bash-completion cronie fping git ImageMagick mariadb-server mtr net-snmp net-snmp-utils nginx nmap php-fpm php-cli php-common php-curl php-gd php-json php-mbstring php-process php-snmp php-xml php-zip php-mysqlnd python3 python3-PyMySQL python3-redis python3-memcached python3-pip rrdtool unzip | ||
+ | </ | ||
+ | * 設定 PHP 時區< | ||
+ | vi / | ||
+ | </ | ||
+ | : | ||
+ | date.timezone = Asia/Taipei | ||
+ | : | ||
+ | </ | ||
+ | * 設定 MariaDB <cli> | ||
+ | vi / | ||
+ | </ | ||
+ | innodb_file_per_table=1 | ||
+ | lower_case_table_names=0 | ||
+ | </ | ||
+ | systemctl enable mariadb | ||
+ | systemctl restart mariadb | ||
+ | </ | ||
+ | * 建立透過 192.168.11.xxx 網段可登入的 root 帳號, 密碼 xxxxxxxx< | ||
+ | mysql -u root | ||
+ | </ | ||
+ | CREATE USER ' | ||
+ | GRANT ALL PRIVILEGES ON *.* TO ' | ||
+ | FLUSH PRIVILEGES; | ||
+ | exit | ||
+ | </ | ||
+ | * 設定 php-fpm <cli> | ||
+ | |||
+ | </ | ||
+ | * 設定 nginx web Exp. test.ichiayi.com <cli> | ||
+ | vi / | ||
+ | </ | ||
+ | server { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | gzip on; | ||
+ | | ||
+ | | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
+ | | ||
+ | fastcgi_pass unix:/ | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | include fastcgi.conf; | ||
+ | } | ||
+ | | ||
+ | deny all; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | vi / | ||
+ | </ | ||
+ | : | ||
+ | include / | ||
+ | |||
+ | # server { | ||
+ | # listen | ||
+ | # listen | ||
+ | # server_name | ||
+ | # root / | ||
+ | # | ||
+ | # # Load configuration files for the default server block. | ||
+ | # include / | ||
+ | : | ||
+ | </ | ||
+ | systemctl enable --now nginx | ||
+ | systemctl enable --now php-fpm | ||
+ | </ |