I, Cài đặt nginx

1, Thêm Nginx Repository

2, Cài đặt nginx

3, Khởi động nginx

4, Mở firewall cho HTTP/HTTPS:

Nếu chưa cài đặt firewall thì cần thực hiện các bước sau rồi mới quay lại mở port cho http/https

5, Bật nginx

II, Cài đặt PHP

1, Thêm repository PHP 7.4

2, Cài PHP 7.4 và các extension cần thiết

3, Kiểm tra phiên bản php

4, Cấu hình PHP-FPM cho Nginx

a, Chỉnh php-fpm chạy dưới user nginx:

Thay user = apachegroup = apache thành:

Thay

Bỏ comment và sửa thành

b, Bật và khởi động PHP-FPM:

III, Cài đặt Mysql 8

1, Tắt module MySQL mặc định (nếu cần)

2, Thêm MySQL Community Repo cho EL9:

3, Kiểm tra repo MySQL EL9 đã có:

4, Thiết lập key

5, Cài MySQL server:

6, Khởi động mysql

7, Lấy mật khẩu mysql root tạm thời

8, Thay đổi password root và thiết lập secure

  • Enter password for user root: [Enter temporary password]
  • New password: [Enter a new password]
  • Re-enter new password: [Re-enter new password]
  • Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
  • 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
  • Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
  • Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

IV, Cấu hình nginx domain

1, Tạo folder chứa source code

2, Kiểm tra setenforce đã được tắt chưa

3, Tạo file cấu hình virtural host

Nội dung như sau:

4, Kiểm tra cấu hình và restart lại nginx

V, Tạo mới database

1, Đăng nhập vào mysql root

2, Tạo database, user và thiết lập quyền

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments