- Create database
mysql -uroot -pWelcome123
CREATE DATABASE gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'Welcome123' WITH GRANT OPTION ;
Bài viết giới thiệu tổng quan về Nginx và cách thiết lập cân bằng tải trong hệ thống máy chủ sử dụng Nginx. Trước khi đi vào tìm hiểu vẫn đề này, chúng ta sẽ nói qua chút về Proxy.
Proxy là một Internet server làm nhiệm vụ chuyển tiếp thông tin và kiểm soát tạo sự an toàn cho việc truy cập Internet của các máy khách. Có 2 loại Proxy là Forward proxy và Reverse proxy.
Là khái niệm miêu tả sự kiện proxy nhận dữ liệu từ server và gửi cho client thay vì client nhận dữ liệu trực tiếp từ server. Nếu không chỉ rõ thì khi nói đến proxy có thể hiểu là forward proxy.
Cụ thể, ta có 3 máy tính kết nối tới internet.
#!/bin/sh | |
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/ | |
# GENERAL | |
# print lines begining with range of letters | |
grep ^[A-D] table.txt | |
# REGEX |
# List of cheatsheet for linux find. | |
# Taken from here http://alvinalexander.com/unix/edu/examples/find.shtml | |
# basic 'find file' commands | |
# -------------------------- | |
find / -name foo.txt -type f -print # full command | |
find / -name foo.txt -type f # -print isn't necessary | |
find / -name foo.txt # don't have to specify "type==file" | |
find . -name foo.txt # search under the current dir | |
find . -name "foo.*" # wildcard |
test_command='curl -sL \ | |
-w "%{http_code}\\n" \ | |
"http://localhost:8000/people/" \ | |
-o /dev/null \ | |
--connect-timeout 3 \ | |
--max-time 5' | |
if [[ $(test_command) == "200" ]] ; | |
then | |
echo "OK" ; | |
else |