Skip to main content
Category

Quản trị Server

Fixing “Upstream Prematurely Closed Connection” Error in Nginx

By Quản trị Server, Hosting - Domain, Linux No Comments

I. Introduction Nginx is a popular and widely used open-source web server software. It acts as a reverse proxy server for HTTP, HTTPS, SMTP, and other protocols. However, like any software, Nginx is not immune to errors. One of the most common errors that Nginx users encounter is the “upstream prematurely closed connection” error. In this article, we will discuss…

Read More

Upstream prematurely closed connection while reading response header from upstream

By Linux No Comments

This problem happened because your upstream (php, php-fpm) max_execution_time is shorter than proxy_connect_timeout in your nginx proxy. For example: In my php.ini: But in mysite.conf have: Then I got in error.log of nginx: [error] 117#117: *434 upstream prematurely closed connection while sending to client…. To resolve this problem, increase your max_execution_time to 300. That all! Additional info: https://stackoverflow.com/questions/49508218/upstream-prematurely-closed-connection-while-reading-response-header-from-upstre

Read More

Hướng dẫn cài đặt Memcached trên Ubuntu 20.04 LTS

By Linux No Comments

Tổng quan Memcached là một hệ thống lưu trữ bộ nhớ phân tán mã nguồn mở đặc biệt. Những thông tin được lưu trữ trong Memcached là bản sao các đối tượng (objects) và dữ liệu được người dùng truy cập nhiều lần. Hiểu đơn giản, Memcached được sử dụng để tăng tốc các ứng dụng web động bằng cách…

Read More

Cài Sublime Text 3 trên Ubuntu 18.04

By Quản trị Server, Linux No Comments

The popular cross-platform Sublime Text editor finally offers official Linux apt repository to make it easy to install and receive update in Ubuntu. Sublime Text is a proprietary source code editor with a Python API. It supports many programming languages and markup languages, and its functionality can be extended by users with plugins. It’s available to download and use for free, but you’re supposed…

Read More

Chỉnh múi giờ và tự động cập nhật thời gian trên CentOS hoặc RHEL

By Quản trị Server No Comments

Hôm nay khách hàng kêu con đăng bài lên bị sai giờ, chợt nhớ ra mình chưa cấu hình thời gian gì hết:) Dưới đây mình sẽ hướng dẫn cách chỉnh múi giờ và cấu hình tự động cập nhật giờ online trên CenOS hoặc trên server sử dụng Red Hat Thay đổi múi giờ sang giờ Việt Nam (UTC…

Read More

[Quickstart] Hướng dẫn tạo sudo user trên Ubuntu

By Quản trị Server No Comments

Lệnh sudo cung cấp các đặc quyền của quản trị viên (các lệnh này thường chỉ có user root mới có quyền thực thi) cho người dùng bình thường. Hướng dẫn này sẽ chỉ cho bạn cách dễ nhất để tạo user mới có quyền truy cập sudo trên Ubuntu mà không phải sửa đổi tệp sudoers của máy chủ. Nếu bạn muốn…

Read More

Khám Phá Command-Line trên Linux Phần 3: Xử lý text bằng filter trong Linux (cat, join, paste, sort, head, tail, wc)

By Quản trị Server No Comments

Phần 3: Xử lý text bằng filter trong Linux 1.1. Lệnh combine file CAT Giả sử ta có 2 file text chứa nội dung và giờ ta muống gộp nội dung 2 files vào chung 1 file. Ta sẽ làm điều đó với lệnh cat ( concatenate) file1.txt text from file1 file2.txt text from file2 $ cat file1.txt file2.txt > file3.txt file3.txt…

Read More

Giới hạn CPU Load tránh Overload trên Hostgator

By Hosting - Domain, Quản trị Server No Comments

Hostgator có quy định các host có mức CPU Load cao hơn 2% sẽ tự động bị suppend. Việc giới hạn serrver load trước tình trạng có quá nhiều người truy cập vào website hay tình trạng bị DDOS là rất cần thiết để tránh suppend. Chú ý đoạn code chỉ chạy trên hosting linux Đặt đoạn code sau dưới <?của…

Read More

Tự động tối ưu hóa hình ảnh JPEG, PNG trên Centos 6.x, 7.x và Ubuntu

By Quản trị Server No Comments

Trước đây mình thường tối ưu hóa hình ảnh bằng các công cụ trên máy tính trước khi upload lên, nhưng có vẻ hơi mất thời gian và công sức. Vì thế mình đã cố gắng tìm các công cụ để làm công việc này một cách tự động trên server, nhằm tiết kiệm một chút thời gian dành cho…

Read More

Hướng dẫn đồng bộ dữ liệu bằng Rsync trên Centos

By Quản trị Server No Comments

Mô hình: Server chính: 192.168.1.50 Server phụ: 192.168.1.51 Yêu cầu đặt ra: Đồng bộ hóa dữ liệu một cách tự động thư mục /var/www/html/abc.com/images từ server chính sang server phụ Các bước thực hiện như sau: 1. Cài đặt rsync: Thực hiện trên cả server chính lẫn server phụ yum install rsync 2. Tạo tài khoản thực hiện rsync: Thực…

Read More