Skip to content

Instantly share code, notes, and snippets.

View kanibaspinar's full-sized avatar
🏠
Working from home

Kani kanibaspinar

🏠
Working from home
View GitHub Profile
@kanibaspinar
kanibaspinar / my.cnf
Last active May 28, 2024 09:46
Mysql My.cnf Optimization - Best Performance For 1000 + Sites Web Server
# Optimized MySQL configuration for cPanel servers by Kani Baspinar - Updated June 2016
#
# The settings provided below are a starting point for a 24GB RAM server with 8 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# Test your configuration ; https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
#
@kanibaspinar
kanibaspinar / httpd.conf
Last active March 2, 2020 09:26
Apache Configurations
#This settings are not compatible to each server! Workable Conf ; 24 GB Ram 8 Cpu Dedicated Server #
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 500
MaxRequestWorkers 500 (this option was previously called MaxClients in Apache v2.4)
MaxRequestsPerChild 4000
Timeout 20
# Happy Optimizations $KBŞP #
@kanibaspinar
kanibaspinar / default.conf
Created June 13, 2016 09:20
Prevention of new types of attacks at Layer 7 with nginx
# Back up the old files before editing #
if ($http_user_agent ~* (Trident*) ) {
return 444;
}
if ($http_user_agent ~* (-) ) {
return 444;
}
if ($http_user_agent ~* (Java) ) {
return 444;
}
@kanibaspinar
kanibaspinar / default.conf
Created June 15, 2016 18:07
Prevention of new types of Http Get Flood attacks at Layer 7 with nginx
#
# Hello provide protection for these settings http get flood attacks.
# Please add this rule to the appropriate sections in your default.conf file.
# Please note that the server {} function does not take place in part become invalid
#
set $add 1;
set $ban '';
###### Rule 1 ########
@kanibaspinar
kanibaspinar / wordpress.conf
Created June 18, 2016 09:11
Wordpress security and performance optimization with Nginx
##Please create a file folder named wordpress.conf in /etc/nginx/conf.d insert into these codes##
# Common deny or internal locations, to help prevent access to not-public areas
location ~* wp-admin/includes { deny all; }
location ~* wp-includes/theme-compat/ { deny all; }
location ~* wp-includes/js/tinymce/langs/.*\.php { deny all; }
location /wp-content/ { internal; }
location /wp-includes/ { internal; }
location ~ /(\.|wp-config.php|readme.html|license.txt) { deny all; }
# Add trailing slash to */wp-admin requests.
@kanibaspinar
kanibaspinar / default.conf
Created September 29, 2016 13:44
Cpanel Services Stable With Nginx
#Cpanel Servislerinin rahat calısması için#
location ~* ^/(controlpanel|cpanel|kpanel|securecontrolpanel|securecpanel|securewhm|webmail|whm|bandwidth|img-sys|java-sys|mailman/archives|pipermail|sys_cpanel|cgi-sys|mailman) {
proxy_pass http://server-ip:9999;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#KBSP Cpanel Servislerinin rahat çalışması için#
@kanibaspinar
kanibaspinar / nginx.conf
Created October 7, 2016 06:56
SPDY Protokolleri ile Nginx
# Nginx SPDY Protokolleri
# Bu kurallar HTTPS olmadan çalışmaz
# SPDY Protokolünü aktif et
add_header Alternate-Protocol 443:npn-spdy/3;
# SPDY protokülündeki ziyaretçileri odakla:
spdy_keepalive_timeout 300s; # 180s varsayılan ayardır
# SPDY üst kısım sıkıştırmasını aktif et
@kanibaspinar
kanibaspinar / doc-sec.conf
Created October 7, 2016 07:03
Sistem Dosyalarının Güvenliği - Nginx
# Bu kuralları bilgi dahilinde entegre etmelisiniz.
# Bu kurallar sayesinde uzantısı eklenen dosyalara doğrudan erişimleri dışardan bağlantı denemelerini tamamen engelliyoruz.
location ~* /\.(?!well-known\/) {
deny all;
}
# uzantısı yer alan türlere doğrudan bağlantıyı engelleyelim
location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
deny all;
}
@kanibaspinar
kanibaspinar / nginx.conf
Created February 14, 2017 11:13
Nginx - HTTP2.0 Performance Configuration
# Please do not use http2 integration with nginx. Available in http and server ranges.
# Bu ayarları http2 etkin edilmeden kullanmayın. Aksi durumda performans ve erişim sorunları yaşarsınız.
http2_chunk_size 8k;
http2_body_preread_size 64k;
http2_idle_timeout 3m;
http2_max_concurrent_streams 128;
http2_max_header_size 16k;
http2_max_field_size 4k;
http2_recv_buffer_size 256k;
http2_max_requests 100000;
@kanibaspinar
kanibaspinar / commands
Created February 18, 2017 13:33
Glibc 2.14 Centos 6.8 Update
# Glibc 2.12 sürüm stabilizesi açısından bir çok yazılımsal açık ve performans kaybına neden olmaktadır.
#Bu yüzden 2.14 sürümüne geçiş yapmak sistem sağlığı açısından daha performanslı ve stabil bir altyapıya sahip olmanızı sağlar.
mkdir ~/glibc_install; cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14