Cài đặt & cấu hình website từ đầu: Ubuntu, Mariadb, Nginx, PHP 8.1, Redis
I. Nhận server và đổi thông tin SSH:
- Đăng nhập SSH bằng user root
apt update # update môi trường
ufw enable
ufw allow 22
1- Đổi port SSH mặc định:
vi /etc/ssh/sshd_config
tìm kiếm dòng: Port 22.
Thay thế port 22 bằng một port trong khoảng 1024 đến 65536.
2- Cài đặt Nginx:
apt update apt -y install nginx
ufw allow 'Nginx Full'
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
nginx -v
3- Cài đặt Mariadb:
Gỡ bỏ mariadb hiện tại (mặc định) trên ubuntu
Cài đặt mới MariaDBapt-get remove mariadb-server
apt -y install mariadb-server
systemctl status mariadb
mysql_secure_installation (cài đặt bảo mật cho mariadb)
4- Cài đặt PHP:
Gỡ bỏ mariadb hiện tại (mặc định) trên ubuntu
apt-get remove mariadb-server
Cài đặt mới MariaDB
apt -y install mariadb-server
systemctl status mariadb
mysql_secure_installation (cài đặt bảo mật cho mariadb)
Nhận xét
Đăng nhận xét