- Puanlar
- 24089
- Başarılar
- 8
- New
- #1
🚀 VDS Sunucuya Plesk Kurulumu ve Enterprise Seviye Optimizasyon Rehberi - sonmezz.com.tr
Not: Bu rehber sonmezz.com.tr için özel olarak hazırlanmıştır. Tüm komutlar ve ayarlar birebir uygulanabilir.
ÖNEMLİ: Bu rehberdeki tüm komutları sırasıyla uygulayın. Her adım sonrası çıktıları kontrol edin.
1. VDS SUNUCU HAZIRLIĞI
1.1. SSH Bağlantısı
ssh root@sunucu_ip_adresiniz
Not: sonmezz.com.tr için sunucu IP'nizi hosting sağlayıcınızdan öğrenebilirsiniz.
1.2. Sistemi Güncelle (Ubuntu 22.04 LTS)
apt update && apt upgrade -y
apt autoremove -y
apt install -y wget curl nano vim htop net-tools git unzip zip \
software-properties-common apt-transport-https \
ca-certificates gnupg lsb-release screen
1.3. Hostname ve DNS Ayarları
# Hostname ayarla hostnamectl set-hostname server.sonmezz.com.tr # /etc/hosts düzenle cat > /etc/hosts </etc/resolv.conf <
1.4. Swap Alanı (RAM yedeklemesi)
# 2GB swap (RAM'iniz düşükse önemli) fallocate -l 2G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo '/swapfile none swap sw 0 0' >> /etc/fstab # Swap kullanımını optimize et echo "vm.swappiness=10" >> /etc/sysctl.conf echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf sysctl -p
1.5. Zaman Dilimi
timedatectl set-timezone Europe/Istanbul
2. PLESK KURULUMU
2.1. Plesk Tek Tıkla Kurulum
# Plesk installer'ı indir ve çalıştır wget https://autoinstall.plesk.com/plesk-installer chmod +x plesk-installer # Kurulumu başlat (tüm bileşenlerle) ./plesk-installer --select-product-id=plesk --select-release-latest --installation-type=recommended
2.2. Kurulum Süreci
Kurulum 20-30 dakika sürecektir. Bitince şu mesajı göreceksiniz:
Plesk has been successfully installed. Panel URL: https://185.123.45.67:8443 Username: admin Password: (root şifreniz veya oluşturduğunuz şifre)
2.3. Plesk'e İlk Giriş
# Web tarayıcıdan: https://sunucu_ip:8443 # admin / root şifresi ile giriş
2.4. Lisanslama
- Trial Lisans: "Start 15-day Trial" seç
- Satın alınan lisans: Lisans anahtarını gir
2.5. Temel Plesk Ayarları
Plesk panelden sırayla yapılacaklar:
- Araçlar ve Ayarlar > Sunucu Adı
- Sunucu hostname:
server.sonmezz.com.tr
- Sunucu hostname:
- Araçlar ve Ayarlar > IP Adresleri
- IP'leri kontrol et
- Araçlar ve Ayarlar > Beyaz Liste
- Kendi IP'nizi ekle (kendini kilitleme)
- Araçlar ve Ayarlar > Güncellemeler
- "Otomatik güncelleme" aktifleştir
3. PHP OPTİMİZASYONU (php.ini)
3.1. PHP Sürümlerini Kur
Plesk panelden:
- Araçlar ve Ayarlar > PHP Ayarları
- PHP 7.4, 8.0, 8.1, 8.2, 8.3 hepsini kur (müşteriler seçsin)
3.2. Master php.ini (Enterprise Konfigürasyon)
Dosya Konumu: /opt/plesk/php/8.2/etc/php.ini
; =====================================================
; PROFESYONEL HOSTING - PHP 8.2 ENTERPRISE
; sonmezz.com.tr VDS Sunucu için maksimum performans
; =====================================================
[PHP]
; -----------------------------------------------------
; KAYNAK LİMİTLERİ
; -----------------------------------------------------
memory_limit = 512M
max_execution_time = 180
max_input_time = 180
max_input_vars = 5000
realpath_cache_size = 4096K
realpath_cache_ttl = 600
; -----------------------------------------------------
; DOSYA YÜKLEME
; -----------------------------------------------------
file_uploads = On
upload_max_filesize = 64M
post_max_size = 80M
max_file_uploads = 20
upload_tmp_dir = /tmp/php_uploads
; -----------------------------------------------------
; OPCODE ÖNBELLEK (OPCACHE) - KRİTİK!
; -----------------------------------------------------
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 512
opcache.interned_strings_buffer = 64
opcache.max_accelerated_files = 32531
opcache.max_wasted_percentage = 10
opcache.revalidate_freq = 60
opcache.fast_shutdown = 1
opcache.enable_file_override = 0
opcache.protect_memory = 1
opcache.jit = tracing
opcache.jit_buffer_size = 256M
; -----------------------------------------------------
; JIT (PHP 8.x) - Ekstra hız
; -----------------------------------------------------
opcache.jit = 1255
opcache.jit_debug = 0
opcache.jit_bisect_limit = 0
opcache.jit_prof_threshold = 0.005
; -----------------------------------------------------
; OTURUM GÜVENLİĞİ
; -----------------------------------------------------
[Session]
session.save_handler = files
session.save_path = "/var/lib/php/session"
session.use_strict_mode = 1
session.use_cookies = 1
session.use_only_cookies = 1
session.name = "PHPSESSID"
session.cookie_secure = 1
session.cookie_httponly = 1
session.cookie_samesite = "Lax"
session.gc_maxlifetime = 7200
session.sid_length = 48
session.sid_bits_per_character = 6
; -----------------------------------------------------
; GÜVENLİK HARDENING
; -----------------------------------------------------
expose_php = Off
display_errors = Off
display_startup_errors = Off
log_errors = On
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
error_log = /var/log/php-fpm/error.log
; -----------------------------------------------------
; TEHLİKELİ FONKSİYONLARI KAPAT
; -----------------------------------------------------
disable_functions = exec, system, passthru, shell_exec, popen, proc_open,
proc_close, proc_get_status, proc_nice, show_source,
highlight_file, symlink, link, pcntl_alarm, pcntl_fork
; -----------------------------------------------------
; URL FOPEN KAPAT (RFI koruması)
; -----------------------------------------------------
allow_url_fopen = Off
allow_url_include = Off
; -----------------------------------------------------
; ZAMAN DİLİMİ
; -----------------------------------------------------
date.timezone = "Europe/Istanbul"
3.3. Tüm PHP Sürümlerine Uygula
cp /opt/plesk/php/8.2/etc/php.ini /opt/plesk/php/8.3/etc/ cp /opt/plesk/php/8.2/etc/php.ini /opt/plesk/php/8.1/etc/ cp /opt/plesk/php/8.2/etc/php.ini /opt/plesk/php/8.0/etc/ cp /opt/plesk/php/8.2/etc/php.ini /opt/plesk/php/7.4/etc/
3.4. PHP Servislerini Yeniden Başlat
systemctl restart php8.2-fpm systemctl restart php8.3-fpm systemctl restart php8.1-fpm systemctl restart php8.0-fpm systemctl restart php7.4-fpm