Danh mục: Ubuntu
-
rsync over tunnel
rsync -av -e “ssh -A root@{SERVER IP TUNNEL} ssh” root@{SERVER IP TARGET}:/home/temp.txt /tmp/
-
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; }
-
php-fpm
Với CentOS 7 – 8 Lệnh restart PHP-FPM trên CentOS 7 – 8 Sử dụng lệnh sau để restart PHP-FPM: $ sudo systemctl restart php-fpm Bạn cũng cần nắm những lệnh sau để sử dụng trong quá trình làm việc với PHP-FPM trên CentOS 7 & 8: Lệnh start PHP-FPM: $ sudo systemctl start php-fpm…
-
command server
Supervisor sudo systemctl start supervisor supervisorctl Mysql /etc/mysql/conf.d/mysql.cnf /etc/init.d/mysql restart
-
import mysql with special port
mysql -h 127.0.0.1 -P 3307 -uroot -p db_name < /db.sql
-
Moving server with docker, rsync
sudo docker ps #Show container id #chat service sudo docker exec -i {CONTAINER_ID} /usr/bin/mongodump –uri “mongodb://” –archive > /mnt/storage/mongodb.dump sudo docker exec -i {CONTAINER_ID} /usr/bin/mongorestore –uri “mongodb://” –archive –drop < /mnt/storage/mongodb.dump #database sudo docker exec -i {CONTAINER_ID} mysql -uhanda -p{PASSWORD} handa < /mnt/storage/database.sql #storage log sudo rsync -avh target_server:/var/www/storage/ /mnt/storage/
-
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