Skip to content

Instantly share code, notes, and snippets.

php7.0

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w php70w-opcache php70w-fpm php70w-common php70w-cli php70w-devel php70w-gd php70w-imap php70w-intl php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-pear 
yum install php70w-pecl-apcu php70w-pecl-memcached php70w-pecl-mongodb php70w-pecl-redis php70w-pecl-xdebug php70w-soap php70w-xmlrpc
@dinhkk
dinhkk / nginx-tuning.md
Created January 24, 2019 07:36 — 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.

@dinhkk
dinhkk / docker-comman.md
Last active April 19, 2018 03:28
docker comman

How to run a docker centos 7 lastest

1 Pull an image centos7 from docker hub : https://hub.docker.com/_/centos/

docker pull centos

2 build a docker container from pulled image

Install fail2ban

yum install epel-release
sudo nano /etc/fail2ban/jail.local
[DEFAULT]
# Ban hosts for one hour:

1. display all opened ports

lsof -PiTCP -sTCP:LISTEN

2. disable httpd default

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

Config permissions for shared folder Source : https://stackoverflow.com/questions/37871470/how-to-change-permission-of-vmwares-shared-folder Command: vmhgfs-fuse .host:/ /mnt/hgfs -o uid=1000 -o gid=1000 -o umask=0033

Install vmware tools

yum install perl gcc make kernel-headers kernel-devel -y
yum install libmspack-devel xerces-c-devel libxml-security-c-devel gtkmm24-devel procps-ng-devel libdnet-devel libXtst-devel libsigc++20-devel pam-devel fuse-devel
yum install CUnit-devel
@dinhkk
dinhkk / mysql tunner.md
Last active January 24, 2018 04:09 — forked from insytes/mysqldump-ignore-multiple-tables
mysqldump ignore multiple tables

rsync - copy / synchronization

copy file: copy file 'backup.18-11-2017_09:40:15.fbsale.sql' from remote server to local file 'www/backup.18-11-2017_09:40:15.fbsale.sql'

rsync -avzP root@{server-ip}:/data/backup/backup.18-11-2017_09:40:15.fbsale.sql /var/www/backup.18-11-2017_09:40:15.fbsale.sql

copy folder: copy all files from remote server's folder 'backup', to local folder 'backup'

@dinhkk
dinhkk / php5.6 + nginx + mariaDB on centos-7
Last active November 19, 2017 13:11
bash install centos 7
#login as root
yum update
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#install php
yum install php56w-fpm php56w-opcache
yum install php56w
yum install php56w-bcmath php56w-common php56w-devel php56w-gd php56w-imap php56w-intl php56w-ldap
@dinhkk
dinhkk / letenscript.md
Last active October 16, 2017 07:27
command create ssl with letsencrypt

./letsencrypt-auto certonly -a webroot --webroot-path=/var/www/webrtc -d webrtcdemo.tk -d www.webrtcdemo.tk

create file /etc/nginx/snippets/ssl.conf

ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

ssl_protocols TLSv1.2;