Skip to content

Instantly share code, notes, and snippets.

View thuyhiend's full-sized avatar

Nguyễn Thúy Hiền thuyhiend

View GitHub Profile
@thuyhiend
thuyhiend / content.html
Created January 3, 2020 01:09
Sample Content Apache
<html>
<h1>
Chào mừng bạn đến với Cloud365!
</h1>
<br>
<image src = "https://www.maboitesurlenet.fr/wp-content/uploads/2014/03/printemps-621x320.jpg">
</html>
@thuyhiend
thuyhiend / lemp_wordpress.sh
Last active December 25, 2019 12:56
Script instal LEMP Wordpress
#!/bin/bash
#Function check user root
f_check_root () {
if(( $EUID == 0)); then
#if user is root, continue to function f_sub_main
f_sub_main
else
#if user not root, print message and exit script
echo "Please run this script by user root!"
@thuyhiend
thuyhiend / create_db.md
Last active August 30, 2022 01:06
Script to install LEMP + Wordpress
#!/bin/bash
mysql -uroot -pabc@123<<MYSQL_SCRIPT
CREATE DATABASE wordpress;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'Thuctap@2019';
GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@thuyhiend
thuyhiend / nginx-tuning.md
Created December 18, 2019 03:37 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@thuyhiend
thuyhiend / config_file_nginx.md
Last active December 18, 2019 03:45
/etc/nginx/conf/nginx.cnf
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;
@thuyhiend
thuyhiend / 3 Master
Last active May 19, 2020 12:03
Cấu hình Replication 3 master
```
## Master-1
create database replica_db;
create user 'slave'@'10.10.22.104' identified by 'abc@123';
create user 'slave'@'10.10.22.105' identified by 'abc@123';
grant replication slave on *.* to 'slave'@'10.10.22.104' identified by 'abc@123';
grant replication slave on *.* to 'slave'@'10.10.22.105' identified by 'abc@123';
vi /etc/my.cnf.d/mariadb-server.cnf
[mariadb]

Tải file mẫu về

wget https://gist.github.com/congto/735a0dce8f4adc91d5886c12303b05f3/raw/6f5130fe7a83bcb8836476f544094b675b661570/filethuchanh.conf

Hoặc tự tạo file mẫu với nội dung dưới và lưu lại với tên file là filethuchanh.conf

# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]