create a new user using the following command:
sudo adduser haidoan
Next, we switch the shell session to the new account:
sudo su haidoan
Create .ssh directory, and change the directory permission to 700 (only the file owner can read, write or open the directory):
mkdir .ssh
chmod 700 .ssh
Create an empty file called authorized_keys in the .ssh directory and change its permissions to 600 (only the file owner can read or writ eto the file)
touch authorized_keys
chmod 600 authorized_keys
Finally, edit the authorized_keys file and paste in your public key.
We now are logged in as user haidoan
mkdir -p /var/www/ihadas.com/{public_html,logs,backup}
Config nignx
server {
listen 80;
listen [::]:80;
root /var/www/ihadas.com/public_html;
index index.php index.html index.htm;
server_name ihadas.com www.ihadas.com;
access_log /var/www/ihadas.com/logs/access.log;
error_log /var/www/ihadas.com/logs/error.log;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
#include fastcgi_params;
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
}
location ~ /\.ht {
deny all;
}
}
=============================================================
– Kiểm tra múi giờ hiện tại:
date
– Cập nhật lại timezone sang Asia/Ho_Chi_Minh:
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
=============================================================
- Kiểm tra dung lượng ổ cứng mà các file hệ thống sử dụng.
[root@vultr ~]# df
- Hiện thị thông tin ổ đĩa các file hệ thống sử dụng
[root@vultr ~]# df -a
- Hiển thị dung lượng đĩa sử dụng dạng MB và GB
[root@vultr ~]# df -h
- Hiện thị thông tin về thư mục Home
[root@vultr ~]# df -hT /home
- Hiển thị thông tin về các file hệ thống theo bytes
[root@vultr ~]# df -k
- Xem thông tin file hệ thống ở MB
[root@vultr ~]# df -m
- Xem thông tin file hệ thống ở GB
[root@vultr ~]# df -h
- Xem thông tin Inodes
[root@vultr ~]# df -i
- Hiển thị thông tin định dạng file hệ thống
[root@vultr ~]# df -T
- Xem các lệnh df
[root@vultr ~]# df --help