Danh mục: Linux
-
set limit request nginx req zone
config ở /etc/nginx/nginx.conf trong http{} limit_req_zone $binary_remote_addr zone=ip:50m rate=30r/s; In location của từng config: limit_req zone=ip burst=30 delay=10; bài viết: https://vietnix.vn/huong-dan-cau-hinh-nginx-rate-limit/
-
set too open many files nginx
worker_rlimit_nofile 100000; events { worker_connections 5000; # multi_accept on; }
-
max connect php fpm
This happens because the operating system rejects nginx’s attempts to connect to a unix socket. The reason is either the maximum number of socket connections or the maximum number of unhandled socket connections has been exceeded. Checking the limits: sysctl net.core We are interested in the lines: net.core.somaxconn = 128 net.core.netdev_max_backlog = 200 Because of…
-
Too many open files
What Is the Too Many Open Files Error? Amongst its other gazillion jobs, the kernel of a Linux computer is always busy watching who’s using how many of the finite system resources, such as RAM and CPU cycles. A multi-user system requires constant attention to make sure people and processes aren’t using more of any given system resource than is appropriate. It’s…
-
create user linux
adduser username passwd username visudo add this: (Có thể tạo 1 nhóm cho group sudo) %admin ALL=(ALL) ALL %sudo ALL=(ALL:ALL) ALL Rồi add user vào nhóm đó: groupadd sudo usermod -a -G sudo username username ALL=(ALL) ALL su – username ssh-keygen touch ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys chmod 700 ~/.ssh delete user: userdel -r username
-
user sudo without password – root
Access root user. visudo tom ALL=(ALL) NOPASSWD:ALL
-
Mongo exit code
sudo rm -rf /tmp/mongodb-27017.sock sudo service mongod start
-
Lỗi cors server
Khi lỗi cors mà không thấy báo response thì check xem có thể bị lỗi khác chưa kịp trả response.
-
Config remote mysqldump without password
Edit: ~/.my.cnf [mysqldump] user=root password=123456