{"id":38722,"date":"2026-02-06T11:40:50","date_gmt":"2026-02-06T08:40:50","guid":{"rendered":"https:\/\/fatihsoysal.com\/blog\/?p=38722"},"modified":"2026-02-06T11:40:50","modified_gmt":"2026-02-06T08:40:50","slug":"apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma","status":"publish","type":"post","link":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/","title":{"rendered":"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma"},"content":{"rendered":"<p><body><\/p>\n<h2>Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma<\/h2>\n<h2>Giri\u015f<\/h2>\n<p>G\u00fcn\u00fcm\u00fcz\u00fcn karma\u015f\u0131k web uygulamalar\u0131 ve mikroservis mimarileri, a\u011f trafi\u011fini y\u00f6netmek, performans\u0131 art\u0131rmak ve g\u00fcvenli\u011fi sa\u011flamak i\u00e7in \u00e7e\u015fitli ara\u00e7lar gerektirir. Bu ara\u00e7lardan biri de ters vekil sunucusu (reverse proxy) olarak bilinen yap\u0131d\u0131r. Ters vekil sunucusu, istemcilerden gelen istekleri al\u0131r ve bu istekleri bir veya daha fazla arka u\u00e7 (backend) sunucusuna y\u00f6nlendirir, ard\u0131ndan arka u\u00e7 sunucusundan gelen yan\u0131t\u0131 istemciye geri iletir. Bu makalede, Apache HTTP Sunucusu&#8217;nu Ubuntu 20.04 i\u015fletim sistemi \u00fczerinde <code>mod_proxy<\/code> mod\u00fcl\u00fc arac\u0131l\u0131\u011f\u0131yla nas\u0131l g\u00fc\u00e7l\u00fc bir ters vekil sunucusu olarak yap\u0131land\u0131raca\u011f\u0131m\u0131z\u0131 ayr\u0131nt\u0131l\u0131 olarak inceleyece\u011fiz.<\/p>\n<p>Ters vekil sunucular\u0131, modern web altyap\u0131lar\u0131nda kritik bir rol oynar. G\u00fcvenlik katman\u0131 sa\u011flaman\u0131n yan\u0131 s\u0131ra, y\u00fck dengeleme (load balancing) yaparak trafi\u011fi birden \u00e7ok sunucuya da\u011f\u0131tabilir, SSL\/TLS sonland\u0131rmas\u0131 ger\u00e7ekle\u015ftirebilir, \u00f6nbellekleme (caching) ile performans\u0131 art\u0131rabilir ve farkl\u0131 uygulamalar\u0131 tek bir alan ad\u0131 alt\u0131nda eri\u015filebilir k\u0131labilirler. Apache HTTP Sunucusu, esnekli\u011fi, kararl\u0131l\u0131\u011f\u0131 ve geni\u015f mod\u00fcl deste\u011fi sayesinde bu g\u00f6revler i\u00e7in m\u00fckemmel bir se\u00e7imdir. \u00d6zellikle <code>mod_proxy<\/code> ve onunla ili\u015fkili alt mod\u00fcller (<code>mod_proxy_http<\/code>, <code>mod_proxy_balancer<\/code>, <code>mod_ssl<\/code> vb.) Apache&#8217;yi g\u00fc\u00e7l\u00fc bir ters vekil sunucusu \u00e7\u00f6z\u00fcm\u00fcne d\u00f6n\u00fc\u015ft\u00fcr\u00fcr.<\/p>\n<p>Bu makalede, \u00f6ncelikle Apache&#8217;nin ve gerekli mod\u00fcllerin kurulumunu ve temel yap\u0131land\u0131rmas\u0131n\u0131 ele alaca\u011f\u0131z. Ard\u0131ndan, basit bir ters vekil senaryosundan ba\u015flayarak, URL tabanl\u0131 y\u00f6nlendirme, SSL\/TLS sonland\u0131rma, y\u00fck dengeleme, \u00f6nbellekleme ve WebSocket deste\u011fi gibi daha geli\u015fmi\u015f yap\u0131land\u0131rmalar\u0131 ad\u0131m ad\u0131m a\u00e7\u0131klayaca\u011f\u0131z. Son olarak, g\u00fcvenlik hususlar\u0131na ve yayg\u0131n sorun giderme ipu\u00e7lar\u0131na de\u011finece\u011fiz. Bu k\u0131lavuzun sonunda, Apache&#8217;yi kendi \u00f6zel ihtiya\u00e7lar\u0131n\u0131za g\u00f6re bir ters vekil sunucusu olarak ba\u015far\u0131yla yap\u0131land\u0131rabilecek bilgiye sahip olacaks\u0131n\u0131z.<\/p>\n<h2>\u00d6n Ko\u015fullar<\/h2>\n<p>Bu k\u0131lavuzu takip edebilmek i\u00e7in a\u015fa\u011f\u0131daki \u00f6n ko\u015fullar\u0131n kar\u015f\u0131land\u0131\u011f\u0131ndan emin olun:<\/p>\n<p>*   <strong>Ubuntu 20.04 Sunucusu:<\/strong> Temiz bir Ubuntu 20.04 LTS (Focal Fossa) kurulumuna sahip bir sunucuya eri\u015fiminiz olmal\u0131.<br \/>\n*   <strong>Sudo Ayr\u0131cal\u0131klar\u0131:<\/strong> <code>sudo<\/code> ayr\u0131cal\u0131klar\u0131na sahip bir kullan\u0131c\u0131 veya <code>root<\/code> kullan\u0131c\u0131s\u0131 ile oturum a\u00e7m\u0131\u015f olmal\u0131s\u0131n\u0131z.<br \/>\n*   <strong>Apache2 Kurulumu:<\/strong> Apache HTTP Sunucusu&#8217;nun sunucunuzda kurulu olmas\u0131 gerekmektedir. E\u011fer kurulu de\u011filse, sonraki b\u00f6l\u00fcmde kurulum ad\u0131mlar\u0131n\u0131 bulacaks\u0131n\u0131z.<br \/>\n*   <strong>Temel A\u011f Bilgisi:<\/strong> IP adresleri, portlar ve alan adlar\u0131 gibi temel a\u011f kavramlar\u0131na a\u015fina olmak faydal\u0131 olacakt\u0131r.<br \/>\n*   <strong>Backend Sunucusu:<\/strong> Ters vekil sunucusunun istekleri y\u00f6nlendirece\u011fi en az bir arka u\u00e7 (backend) web sunucusu (\u00f6rne\u011fin, Nginx, Node.js uygulamas\u0131, ba\u015fka bir Apache sunucusu vb.) haz\u0131r olmal\u0131d\u0131r. Bu sunucunun IP adresi ve port numaras\u0131 gerekecektir.<\/p>\n<h2>Apache ve Gerekli Mod\u00fcllerin Kurulumu<\/h2>\n<p>E\u011fer Apache sunucunuz kurulu de\u011filse veya gerekli mod\u00fcller etkinle\u015ftirilmemi\u015fse, a\u015fa\u011f\u0131daki ad\u0131mlar\u0131 izleyerek kurulumu ger\u00e7ekle\u015ftirebilirsiniz.<\/p>\n<h3>Sistem G\u00fcncellemesi<\/h3>\n<p>\u0130lk olarak, sunucunuzdaki paket listelerini g\u00fcncelleyin ve mevcut paketleri y\u00fckseltin:<\/p>\n<pre><code class=\"language-bash\">sudo apt update\nsudo apt upgrade -y<\/code><\/pre>\n<h3>Apache2 Kurulumu<\/h3>\n<p>E\u011fer Apache hen\u00fcz kurulu de\u011filse, a\u015fa\u011f\u0131daki komutla kurun:<\/p>\n<pre><code class=\"language-bash\">sudo apt install apache2 -y<\/code><\/pre>\n<p>Kurulum tamamland\u0131ktan sonra Apache servisinin \u00e7al\u0131\u015ft\u0131\u011f\u0131ndan emin olun ve sistem ba\u015flang\u0131c\u0131nda otomatik ba\u015flamas\u0131 i\u00e7in etkinle\u015ftirin:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl start apache2\nsudo systemctl enable apache2\nsudo systemctl status apache2<\/code><\/pre>\n<p><code>sudo systemctl status apache2<\/code> komutu \u00e7\u0131kt\u0131s\u0131nda <code>active (running)<\/code> ifadesini g\u00f6rmelisiniz.<\/p>\n<h3>Gerekli Mod\u00fcllerin Etkinle\u015ftirilmesi<\/h3>\n<p>Apache&#8217;yi ters vekil sunucusu olarak kullanmak i\u00e7in <code>mod_proxy<\/code> ve onunla ili\u015fkili \u00e7e\u015fitli mod\u00fcllere ihtiyac\u0131m\u0131z var. Temel bir ters vekil yap\u0131land\u0131rmas\u0131 i\u00e7in <code>mod_proxy<\/code> ve <code>mod_proxy_http<\/code> gereklidir. Geli\u015fmi\u015f senaryolar i\u00e7in ek mod\u00fcller gerekecektir:<\/p>\n<p>*   <strong><code>mod_proxy<\/code><\/strong>: Ana vekil sunucu mod\u00fcl\u00fc.<br \/>\n*   <strong><code>mod_proxy_http<\/code><\/strong>: HTTP\/HTTPS isteklerini vekil olarak iletmek i\u00e7in gereklidir.<br \/>\n*   <strong><code>mod_proxy_balancer<\/code><\/strong>: Y\u00fck dengeleme \u00f6zellikleri i\u00e7in.<br \/>\n*   <strong><code>mod_lbmethod_byrequests<\/code><\/strong>: Y\u00fck dengeleme algoritmalar\u0131ndan biri (istek say\u0131s\u0131na g\u00f6re). Di\u011ferleri de mevcuttur.<br \/>\n*   <strong><code>mod_ssl<\/code><\/strong>: SSL\/TLS sonland\u0131rmas\u0131 i\u00e7in.<br \/>\n*   <strong><code>mod_headers<\/code><\/strong>: HTTP ba\u015fl\u0131klar\u0131n\u0131 de\u011fi\u015ftirmek veya eklemek i\u00e7in.<br \/>\n*   <strong><code>mod_proxy_wstunnel<\/code><\/strong>: WebSocket ba\u011flant\u0131lar\u0131n\u0131 vekil olarak iletmek i\u00e7in.<br \/>\n*   <strong><code>mod_cache<\/code>, <code>mod_cache_disk<\/code><\/strong>: \u00d6nbellekleme i\u00e7in.<\/p>\n<p>\u015eimdi bu mod\u00fclleri etkinle\u015ftirelim. En az\u0131ndan temel ters vekil i\u00e7in gerekli olanlar\u0131 etkinle\u015ftirmekle ba\u015flayabiliriz:<\/p>\n<pre><code class=\"language-bash\">sudo a2enmod proxy\nsudo a2enmod proxy_http\nsudo a2enmod headers # Genellikle faydal\u0131d\u0131r<\/code><\/pre>\n<p>E\u011fer SSL\/TLS sonland\u0131rmas\u0131 veya y\u00fck dengeleme gibi geli\u015fmi\u015f \u00f6zellikler kullanacaksan\u0131z, ilgili mod\u00fclleri de etkinle\u015ftirmeniz gerekir:<\/p>\n<pre><code class=\"language-bash\">sudo a2enmod ssl\nsudo a2enmod proxy_balancer\nsudo a2enmod lbmethod_byrequests # Y\u00fck dengeleme i\u00e7in bir y\u00f6ntem\nsudo a2enmod proxy_wstunnel # WebSocket i\u00e7in\nsudo a2enmod cache\nsudo a2enmod cache_disk<\/code><\/pre>\n<p>Her mod\u00fcl\u00fc etkinle\u015ftirdikten sonra veya t\u00fcm gerekli mod\u00fclleri etkinle\u015ftirdikten sonra Apache servisini yeniden ba\u015flatman\u0131z gerekir:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl restart apache2<\/code><\/pre>\n<h3>Mod\u00fcllerin Kontrol\u00fc<\/h3>\n<p>Etkinle\u015ftirilen mod\u00fclleri kontrol etmek i\u00e7in a\u015fa\u011f\u0131daki komutu kullanabilirsiniz:<\/p>\n<pre><code class=\"language-bash\">apache2ctl -M | grep proxy\napache2ctl -M | grep ssl\napache2ctl -M | grep cache<\/code><\/pre>\n<p>Bu komutlar, etkinle\u015ftirilen mod\u00fcllerin listesini g\u00f6sterecektir.<\/p>\n<h2>Ters Vekil Sunucu Temelleri<\/h2>\n<p>Apache&#8217;yi ters vekil sunucusu olarak yap\u0131land\u0131rmadan \u00f6nce, baz\u0131 temel kavramlar\u0131 anlamak \u00f6nemlidir.<\/p>\n<h3>mod_proxy Nedir?<\/h3>\n<p><code>mod_proxy<\/code>, Apache HTTP Sunucusu&#8217;nun temel vekil sunucu mod\u00fcl\u00fcd\u00fcr. \u0130stemcilerden gelen istekleri al\u0131r ve bunlar\u0131 ba\u015fka bir sunucuya (arka u\u00e7 sunucusu) iletir. Ard\u0131ndan, arka u\u00e7 sunucusundan gelen yan\u0131t\u0131 yakalar ve istemciye geri g\u00f6nderir. Bu, Apache&#8217;nin bir &#8220;arac\u0131&#8221; g\u00f6revi g\u00f6rmesini sa\u011flar.<\/p>\n<h3>Temel Yap\u0131land\u0131rma Ad\u0131mlar\u0131<\/h3>\n<p>Bir ters vekil yap\u0131land\u0131rmas\u0131 genellikle bir sanal ana bilgisayar (Virtual Host) dosyas\u0131 i\u00e7inde yap\u0131l\u0131r. Bu dosyalar <code>\/etc\/apache2\/sites-available\/<\/code> dizininde bulunur.<\/p>\n<p>1.  <strong>Sanal Ana Bilgisayar Dosyas\u0131 Olu\u015fturma:<\/strong> Her bir ters vekil yap\u0131land\u0131rmas\u0131 i\u00e7in ayr\u0131 bir sanal ana bilgisayar dosyas\u0131 olu\u015fturmak en iyi uygulamad\u0131r. \u00d6rne\u011fin, <code>ters-vekil.conf<\/code>.<br \/>\n2.  <strong><code>ProxyRequests Off<\/code><\/strong>: Bu direktif kritik \u00f6neme sahiptir. <code>ProxyRequests On<\/code> olarak ayarland\u0131\u011f\u0131nda, Apache bir ileri vekil sunucusu (forward proxy) gibi davran\u0131r; yani, istemcilerin internet \u00fczerindeki herhangi bir sunucuya eri\u015fmesine izin verir. Bu, g\u00fcvenlik a\u00e7\u0131klar\u0131 yaratabilir. Ters vekil sunucusu olarak \u00e7al\u0131\u015f\u0131rken, Apache&#8217;nin yaln\u0131zca yap\u0131land\u0131r\u0131lm\u0131\u015f arka u\u00e7 sunucular\u0131na istekleri y\u00f6nlendirmesi gerekir. Bu nedenle, <code>ProxyRequests Off<\/code> olarak ayarlanmal\u0131d\u0131r.<br \/>\n3.  <strong><code>ProxyPass<\/code> Direktifi<\/strong>: Bu direktif, belirli bir URL yolunu veya t\u00fcm istekleri bir arka u\u00e7 sunucusuna y\u00f6nlendirmek i\u00e7in kullan\u0131l\u0131r.<br \/>\n    *   S\u00f6zdizimi: <code>ProxyPass [URL_Yolu] [Arka_U\u00e7_URL]<\/code><br \/>\n    *   \u00d6rnek: <code>ProxyPass \/ http:\/\/backend_sunucu_ip:port\/<\/code><br \/>\n4.  <strong><code>ProxyPassReverse<\/code> Direktifi<\/strong>: Bu direktif, arka u\u00e7 sunucusundan gelen HTTP yan\u0131t ba\u015fl\u0131klar\u0131ndaki (\u00f6zellikle <code>Location<\/code>, <code>Content-Location<\/code> ve <code>URI<\/code> ba\u015fl\u0131klar\u0131) y\u00f6nlendirme URL&#8217;lerini otomatik olarak yeniden yazar. Bu, istemcinin arka u\u00e7 sunucusunun dahili URL&#8217;leri yerine ters vekil sunucusunun URL&#8217;lerini g\u00f6rmesini sa\u011flar ve y\u00f6nlendirmelerin do\u011fru \u00e7al\u0131\u015fmas\u0131n\u0131 garanti eder.<\/p>\n<h2>Basit Bir Ters Vekil Yap\u0131land\u0131rmas\u0131<\/h2>\n<p>\u015eimdi, Apache&#8217;yi basit bir ters vekil sunucusu olarak yap\u0131land\u0131rmak i\u00e7in ad\u0131m ad\u0131m bir \u00f6rnek olu\u015ftural\u0131m. Bu senaryoda, Apache&#8217;nin 80 numaral\u0131 portundan gelen t\u00fcm istekleri, <code>192.168.1.100<\/code> IP adresindeki 8080 numaral\u0131 portta \u00e7al\u0131\u015fan bir arka u\u00e7 sunucusuna y\u00f6nlendirece\u011fiz.<\/p>\n<h3>Senaryo<\/h3>\n<p>*   <strong>\u00d6n U\u00e7 (Ters Vekil):<\/strong> Apache HTTP Sunucusu (Bu sunucu)<br \/>\n*   <strong>Arka U\u00e7:<\/strong> <code>http:\/\/192.168.1.100:8080<\/code> adresindeki herhangi bir web uygulamas\u0131 veya sunucusu.<br \/>\n*   <strong>Alan Ad\u0131:<\/strong> <code>example.com<\/code> (veya sunucunuzun IP adresi).<\/p>\n<h3>Yap\u0131land\u0131rma Ad\u0131mlar\u0131<\/h3>\n<p>1.  <strong>Yeni Bir Sanal Ana Bilgisayar Dosyas\u0131 Olu\u015fturma:<\/strong><br \/>\n    Yeni bir yap\u0131land\u0131rma dosyas\u0131 olu\u015ftural\u0131m:<\/p>\n<pre><code class=\"language-bash\">sudo nano \/etc\/apache2\/sites-available\/example.com.conf<\/code><\/pre>\n<p>2.  <strong>Yap\u0131land\u0131rma \u0130\u00e7eri\u011fini Ekleme:<\/strong><br \/>\n    Dosyan\u0131n i\u00e7ine a\u015fa\u011f\u0131daki i\u00e7eri\u011fi yap\u0131\u015ft\u0131r\u0131n. <code>ServerName<\/code> ve <code>ServerAdmin<\/code> de\u011ferlerini kendi alan ad\u0131n\u0131z ve e-posta adresinizle de\u011fi\u015ftirmeyi unutmay\u0131n. Ayr\u0131ca <code>ProxyPass<\/code> ve <code>ProxyPassReverse<\/code> direktiflerindeki arka u\u00e7 sunucu adresini kendi arka u\u00e7 sunucunuzun IP adresi ve portu ile de\u011fi\u015ftirin.<\/p>\n<pre><code class=\"language-apache\"><VirtualHost *:80>\n        ServerAdmin webmaster@example.com\n        ServerName example.com\n        # E\u011fer alan ad\u0131n\u0131z yoksa veya test ediyorsan\u0131z ServerName yerine ServerAlias kullanabilirsiniz\n        # ServerAlias www.example.com\n\n        # Bu, Apache'nin bir ileri vekil sunucusu olarak \u00e7al\u0131\u015fmas\u0131n\u0131 engeller.\n        # Ters vekil sunucusu i\u00e7in kritik bir ayard\u0131r.\n        ProxyRequests Off\n\n        # \u0130stemci HTTP ba\u015fl\u0131klar\u0131n\u0131 Proxy'ye aktar\n        ProxyPreserveHost On\n\n        # Hata g\u00fcnl\u00fckleri ve eri\u015fim g\u00fcnl\u00fckleri\n        ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n        CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n        # T\u00fcm istekleri belirtilen arka u\u00e7 sunucusuna y\u00f6nlendir\n        ProxyPass \/ http:\/\/192.168.1.100:8080\/\n        # Arka u\u00e7tan gelen y\u00f6nlendirmeleri ters vekil sunucusunun alan ad\u0131na g\u00f6re yeniden yaz\n        ProxyPassReverse \/ http:\/\/192.168.1.100:8080\/\n\n        # G\u00fcvenlik i\u00e7in eri\u015fim kontrol\u00fc\n        <Location \/>\n            Require all granted\n            # E\u011fer belirli IP'lerden eri\u015fime izin vermek isterseniz:\n            # Require ip 192.168.1.0\/24\n            # Require ip 127.0.0.1\n        <\/Location>\n    <\/VirtualHost><\/code><\/pre>\n<p>3.  <strong>Yap\u0131land\u0131rmay\u0131 Etkinle\u015ftirme:<\/strong><br \/>\n    Yeni sanal ana bilgisayar dosyas\u0131n\u0131 etkinle\u015ftirin ve varsay\u0131lan Apache kar\u015f\u0131lama sayfas\u0131n\u0131 devre d\u0131\u015f\u0131 b\u0131rak\u0131n (\u00e7ak\u0131\u015fmalar\u0131 \u00f6nlemek i\u00e7in):<\/p>\n<pre><code class=\"language-bash\">sudo a2ensite example.com.conf\n    sudo a2dissite 000-default.conf # E\u011fer gerekliyse<\/code><\/pre>\n<p>4.  <strong>Yap\u0131land\u0131rma S\u00f6zdizimini Kontrol Etme:<\/strong><br \/>\n    Apache yap\u0131land\u0131rmas\u0131nda herhangi bir hata olup olmad\u0131\u011f\u0131n\u0131 kontrol edin:<\/p>\n<pre><code class=\"language-bash\">sudo apachectl configtest<\/code><\/pre>\n<p>    <code>Syntax OK<\/code> \u00e7\u0131kt\u0131s\u0131n\u0131 g\u00f6rmelisiniz. Herhangi bir hata varsa, nano d\u00fczenleyiciye d\u00f6n\u00fcp d\u00fczeltin.<\/p>\n<p>5.  <strong>Apache&#8217;yi Yeniden Ba\u015flatma:<\/strong><br \/>\n    De\u011fi\u015fikliklerin etkili olmas\u0131 i\u00e7in Apache servisini yeniden ba\u015flat\u0131n:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl restart apache2<\/code><\/pre>\n<p>6.  <strong>Test Etme:<\/strong><br \/>\n    \u015eimdi taray\u0131c\u0131n\u0131zdan <code>http:\/\/example.com<\/code> (veya sunucunuzun IP adresi) adresine gidin. Arka u\u00e7 sunucunuzda \u00e7al\u0131\u015fan uygulaman\u0131n veya web sayfas\u0131n\u0131n i\u00e7eri\u011fini g\u00f6rmelisiniz. Bu, Apache&#8217;nin ba\u015far\u0131yla bir ters vekil sunucusu olarak \u00e7al\u0131\u015ft\u0131\u011f\u0131n\u0131 g\u00f6sterir.<\/p>\n<h2>Geli\u015fmi\u015f Ters Vekil Yap\u0131land\u0131rmalar\u0131<\/h2>\n<p>Basit bir yap\u0131land\u0131rman\u0131n \u00f6tesine ge\u00e7erek, Apache&#8217;nin <code>mod_proxy<\/code> ile sunabilece\u011fi daha geli\u015fmi\u015f \u00f6zellikleri ke\u015ffedelim.<\/p>\n<h3>URL Tabanl\u0131 Y\u00f6nlendirme<\/h3>\n<p>Farkl\u0131 URL yollar\u0131n\u0131 farkl\u0131 arka u\u00e7 sunucular\u0131na y\u00f6nlendirmek, mikroservis mimarileri veya ayn\u0131 alan ad\u0131 alt\u0131nda birden \u00e7ok uygulamay\u0131 bar\u0131nd\u0131rmak i\u00e7in kullan\u0131\u015fl\u0131d\u0131r.<\/p>\n<p><strong>Senaryo:<\/strong><br \/>\n*   <code>http:\/\/example.com\/app1<\/code> istekleri <code>http:\/\/backend1.local:8080<\/code> adresine gitsin.<br \/>\n*   <code>http:\/\/example.com\/app2<\/code> istekleri <code>http:\/\/backend2.local:8081<\/code> adresine gitsin.<br \/>\n*   Di\u011fer t\u00fcm istekler <code>http:\/\/default-backend.local:8082<\/code> adresine gitsin.<\/p>\n<p><strong>Yap\u0131land\u0131rma:<\/strong><br \/>\n\u00d6nceki <code>example.com.conf<\/code> dosyas\u0131n\u0131 d\u00fczenleyelim:<\/p>\n<pre><code class=\"language-apache\"><VirtualHost *:80>\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n\n    ProxyRequests Off\n    ProxyPreserveHost On\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    # \/app1 ile ba\u015flayan istekleri backend1'e y\u00f6nlendir\n    ProxyPass \/app1\/ http:\/\/backend1.local:8080\/\n    ProxyPassReverse \/app1\/ http:\/\/backend1.local:8080\/\n\n    # \/app2 ile ba\u015flayan istekleri backend2'ye y\u00f6nlendir\n    ProxyPass \/app2\/ http:\/\/backend2.local:8081\/\n    ProxyPassReverse \/app2\/ http:\/\/backend2.local:8081\/\n\n    # Di\u011fer t\u00fcm istekleri varsay\u0131lan backend'e y\u00f6nlendir\n    ProxyPass \/ http:\/\/default-backend.local:8082\/\n    ProxyPassReverse \/ http:\/\/default-backend.local:8082\/\n\n    <Location \/>\n        Require all granted\n    <\/Location>\n<\/VirtualHost><\/code><\/pre>\n<p><strong>\u00d6nemli Not:<\/strong> <code>ProxyPass<\/code> direktifleri s\u0131raya g\u00f6re i\u015flenir. Daha spesifik yollar (\u00f6rne\u011fin <code>\/app1\/<\/code>) daha genel yollardan (\u00f6rne\u011fin <code>\/<\/code>) \u00f6nce gelmelidir.<\/p>\n<h3>SSL\/TLS Sonland\u0131rma<\/h3>\n<p>Ters vekil sunucular\u0131n\u0131n en yayg\u0131n kullan\u0131mlar\u0131ndan biri, SSL\/TLS sonland\u0131rmas\u0131 yapmakt\u0131r. Bu, istemcilerle \u015fifreli ba\u011flant\u0131y\u0131 Apache&#8217;nin kurdu\u011fu, ancak arka u\u00e7 sunucular\u0131yla \u015fifresiz (HTTP) veya ayr\u0131 bir \u015fifreli (HTTPS) ba\u011flant\u0131 kurdu\u011fu anlam\u0131na gelir. Bu, arka u\u00e7 sunucular\u0131n\u0131n SSL sertifikas\u0131 y\u00f6netimi y\u00fck\u00fcn\u00fc azalt\u0131r ve performans\u0131 art\u0131rabilir.<\/p>\n<p><strong>\u00d6n Ko\u015ful:<\/strong> <code>mod_ssl<\/code> etkinle\u015ftirilmi\u015f olmal\u0131 (<code>sudo a2enmod ssl<\/code>). Ayr\u0131ca ge\u00e7erli bir SSL sertifikan\u0131z (Let&#8217;s Encrypt gibi) ve \u00f6zel anahtar\u0131n\u0131z olmal\u0131d\u0131r.<\/p>\n<p><strong>Yap\u0131land\u0131rma:<\/strong><br \/>\n<code>example.com.conf<\/code> dosyas\u0131n\u0131 HTTPS i\u00e7in d\u00fczenleyelim ve yeni bir sanal ana bilgisayar blo\u011fu ekleyelim:<\/p>\n<pre><code class=\"language-apache\"># HTTP'den HTTPS'ye y\u00f6nlendirme (iste\u011fe ba\u011fl\u0131 ama \u00f6nerilir)\n<VirtualHost *:80>\n    ServerName example.com\n    Redirect permanent \/ https:\/\/example.com\/\n<\/VirtualHost>\n\n<VirtualHost *:443>\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n\n    # SSL\/TLS ayarlar\u0131\n    SSLEngine On\n    SSLCertificateFile \/etc\/letsencrypt\/live\/example.com\/fullchain.pem\n    SSLCertificateKeyFile \/etc\/letsencrypt\/live\/example.com\/privkey.pem\n    # Di\u011fer SSL\/TLS g\u00fcvenlik ayarlar\u0131 buraya eklenebilir (ciphers, protocols vb.)\n\n    ProxyRequests Off\n    ProxyPreserveHost On\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    # Backend'e HTTP ile y\u00f6nlendirme (en yayg\u0131n senaryo)\n    ProxyPass \/ http:\/\/192.168.1.100:8080\/\n    ProxyPassReverse \/ http:\/\/192.168.1.100:8080\/\n\n    # Veya Backend'e HTTPS ile y\u00f6nlendirme (e\u011fer backend de HTTPS kullan\u0131yorsa)\n    # Bu durumda SSLProxyEngine On da gereklidir.\n    # SSLProxyEngine On\n    # ProxyPass \/ https:\/\/192.168.1.100:8443\/\n    # ProxyPassReverse \/ https:\/\/192.168.1.100:8443\/\n\n    <Location \/>\n        Require all granted\n    <\/Location>\n<\/VirtualHost><\/code><\/pre>\n<p>Yap\u0131land\u0131rmay\u0131 etkinle\u015ftirdikten ve Apache&#8217;yi yeniden ba\u015flatt\u0131ktan sonra, <code>https:\/\/example.com<\/code> adresine eri\u015fiminiz \u015fifreli olacak ve istekler arka uca y\u00f6nlendirilecektir.<\/p>\n<h3>Y\u00fck Dengeleme (Load Balancing)<\/h3>\n<p>Trafi\u011fi birden \u00e7ok arka u\u00e7 sunucusu aras\u0131nda da\u011f\u0131tmak, uygulaman\u0131z\u0131n \u00f6l\u00e7eklenebilirli\u011fini ve kullan\u0131labilirli\u011fini art\u0131r\u0131r. Apache <code>mod_proxy_balancer<\/code> mod\u00fcl\u00fc ile y\u00fck dengeleme yapabilir.<\/p>\n<p><strong>\u00d6n Ko\u015ful:<\/strong> <code>mod_proxy_balancer<\/code> ve en az bir y\u00fck dengeleme y\u00f6ntemi mod\u00fcl\u00fc (\u00f6rne\u011fin <code>mod_lbmethod_byrequests<\/code>) etkinle\u015ftirilmi\u015f olmal\u0131.<\/p>\n<p><strong>Senaryo:<\/strong> \u0130ki farkl\u0131 arka u\u00e7 sunucusu (<code>backend1.local:8080<\/code> ve <code>backend2.local:8081<\/code>) aras\u0131nda y\u00fck dengeleme yapmak.<\/p>\n<p><strong>Yap\u0131land\u0131rma:<\/strong><br \/>\n<code>example.com.conf<\/code> dosyas\u0131n\u0131 d\u00fczenleyelim:<\/p>\n<pre><code class=\"language-apache\"><VirtualHost *:80>\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n\n    ProxyRequests Off\n    ProxyPreserveHost On\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    # Balancer k\u00fcmesini tan\u0131mla\n    <Proxy balancer:\/\/mycluster>\n        # \u00dcye sunucular\n        BalancerMember http:\/\/backend1.local:8080\/ route=1\n        BalancerMember http:\/\/backend2.local:8081\/ route=2\n\n        # Y\u00fck dengeleme algoritmas\u0131 (\u00f6rne\u011fin, byrequests - varsay\u0131lan)\n        ProxySet lbmethod=byrequests\n\n        # Di\u011fer se\u00e7enekler:\n        # ProxySet stickysession=JSESSIONID|jsessionid # Oturum yap\u0131\u015fkanl\u0131\u011f\u0131 i\u00e7in\n        # ProxySet nofailover=On # Ba\u015far\u0131s\u0131z sunucuya ge\u00e7i\u015fi engeller\n    <\/Proxy>\n\n    # T\u00fcm istekleri balancer k\u00fcmesine y\u00f6nlendir\n    ProxyPass \/ balancer:\/\/mycluster\/\n    ProxyPassReverse \/ balancer:\/\/mycluster\/\n\n    <Location \/>\n        Require all granted\n    <\/Location>\n<\/VirtualHost><\/code><\/pre>\n<p><strong>Y\u00fck Dengeleme Algoritmalar\u0131:<\/strong><br \/>\n*   <strong><code>byrequests<\/code> (Varsay\u0131lan):<\/strong> \u0130stek say\u0131s\u0131na g\u00f6re dengeler.<br \/>\n*   <strong><code>bytraffic<\/code>:<\/strong> Trafik miktar\u0131na (bayt) g\u00f6re dengeler.<br \/>\n*   <strong><code>bybusyness<\/code>:<\/strong> Sunucunun mevcut ba\u011flant\u0131 say\u0131s\u0131na g\u00f6re dengeler. Daha az me\u015fgul olan sunucuya y\u00f6nlendirir.<br \/>\n*   <strong><code>wrr<\/code> (Weighted Round Robin):<\/strong> A\u011f\u0131rl\u0131kl\u0131 d\u00f6ng\u00fcsel. <code>BalancerMember<\/code> direktifine <code>loadfactor=X<\/code> ekleyerek a\u011f\u0131rl\u0131k belirleyebilirsiniz.<\/p>\n<p><strong>Oturum Yap\u0131\u015fkanl\u0131\u011f\u0131 (Sticky Sessions):<\/strong><br \/>\nBaz\u0131 uygulamalar, belirli bir istemcinin her zaman ayn\u0131 arka u\u00e7 sunucusuna y\u00f6nlendirilmesini gerektirir (\u00f6rne\u011fin, oturum durumunu korumak i\u00e7in). <code>ProxySet stickysession<\/code> direktifi ile bu sa\u011flanabilir. Yukar\u0131daki \u00f6rnekte <code>JSESSIONID<\/code> veya <code>jsessionid<\/code> gibi bir \u00e7erez ad\u0131 belirterek bu \u00e7erezi ta\u015f\u0131yan istekleri ayn\u0131 sunucuya y\u00f6nlendirebilirsiniz.<\/p>\n<h3>\u00d6nbellekleme (Caching)<\/h3>\n<p>Apache, <code>mod_cache<\/code> ve <code>mod_cache_disk<\/code> (veya <code>mod_cache_socache<\/code>) mod\u00fclleri ile ters vekil olarak \u00f6nbellekleme yapabilir. Bu, arka u\u00e7 sunucusuna yap\u0131lan tekrar eden isteklerin say\u0131s\u0131n\u0131 azaltarak performans\u0131 \u00f6nemli \u00f6l\u00e7\u00fcde art\u0131r\u0131r.<\/p>\n<p><strong>\u00d6n Ko\u015ful:<\/strong> <code>mod_cache<\/code> ve <code>mod_cache_disk<\/code> etkinle\u015ftirilmi\u015f olmal\u0131.<\/p>\n<p><strong>Yap\u0131land\u0131rma:<\/strong><br \/>\n<code>example.com.conf<\/code> dosyas\u0131n\u0131 d\u00fczenleyelim:<\/p>\n<pre><code class=\"language-apache\"><VirtualHost *:80>\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n\n    ProxyRequests Off\n    ProxyPreserveHost On\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    # \u00d6nbellek dizinini ve ayarlar\u0131n\u0131 tan\u0131mla\n    <IfModule mod_cache_disk.c>\n        CacheRoot \/var\/cache\/apache2\/proxy\n        CacheDirLevels 2\n        CacheEnable disk \/\n        CacheMaxExpire 3600 # \u00d6nbellekteki \u00f6\u011felerin maksimum \u00f6mr\u00fc (saniye)\n        CacheDefaultExpire 600 # Varsay\u0131lan \u00f6m\u00fcr\n        CacheMinFileSize 1024 # \u00d6nbelle\u011fe al\u0131nacak minimum dosya boyutu (bayt)\n        CacheMaxFileSize 10485760 # \u00d6nbelle\u011fe al\u0131nacak maksimum dosya boyutu (bayt)\n    <\/IfModule>\n\n    ProxyPass \/ http:\/\/192.168.1.100:8080\/\n    ProxyPassReverse \/ http:\/\/192.168.1.100:8080\/\n\n    <Location \/>\n        Require all granted\n    <\/Location>\n<\/VirtualHost><\/code><\/pre>\n<p><strong>\u00d6nbellek Dizinini Olu\u015fturma:<\/strong><br \/>\n<code>CacheRoot<\/code> olarak belirtilen dizinin mevcut oldu\u011fundan ve Apache kullan\u0131c\u0131s\u0131n\u0131n (genellikle <code>www-data<\/code>) yazma izinlerine sahip oldu\u011fundan emin olun:<\/p>\n<pre><code class=\"language-bash\">sudo mkdir -p \/var\/cache\/apache2\/proxy\nsudo chown -R www-data:www-data \/var\/cache\/apache2\/proxy<\/code><\/pre>\n<p>Apache&#8217;yi yeniden ba\u015flatt\u0131ktan sonra, istekler \u00f6nbelle\u011fe al\u0131nmaya ba\u015flayacakt\u0131r. \u00d6nbellekleme, arka u\u00e7 sunucusunun <code>Cache-Control<\/code> ve <code>Expires<\/code> ba\u015fl\u0131klar\u0131n\u0131 dikkate al\u0131r.<\/p>\n<h3>WebSocket Deste\u011fi<\/h3>\n<p>Modern web uygulamalar\u0131, ger\u00e7ek zamanl\u0131 ileti\u015fim i\u00e7in s\u0131k\u00e7a WebSocket kullan\u0131r. Apache <code>mod_proxy_wstunnel<\/code> mod\u00fcl\u00fc, WebSocket ba\u011flant\u0131lar\u0131n\u0131 ters vekil olarak iletmenizi sa\u011flar.<\/p>\n<p><strong>\u00d6n Ko\u015ful:<\/strong> <code>mod_proxy_wstunnel<\/code> etkinle\u015ftirilmi\u015f olmal\u0131.<\/p>\n<p><strong>Senaryo:<\/strong> <code>http:\/\/example.com\/ws<\/code> adresine gelen WebSocket ba\u011flant\u0131lar\u0131n\u0131 <code>ws:\/\/backend.local:8080\/websocket<\/code> adresine y\u00f6nlendirmek.<\/p>\n<p><strong>Yap\u0131land\u0131rma:<\/strong><br \/>\n<code>example.com.conf<\/code> dosyas\u0131n\u0131 d\u00fczenleyelim:<\/p>\n<pre><code class=\"language-apache\"><VirtualHost *:80>\n    ServerAdmin webmaster@example.com\n    ServerName example.com\n\n    ProxyRequests Off\n    ProxyPreserveHost On\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    # HTTP isteklerini y\u00f6nlendir\n    ProxyPass \/ http:\/\/192.168.1.100:8080\/\n    ProxyPassReverse \/ http:\/\/192.168.1.100:8080\/\n\n    # WebSocket isteklerini y\u00f6nlendir\n    # \/ws ile ba\u015flayan istekleri ws:\/\/ protokol\u00fc ile backend'e y\u00f6nlendir\n    ProxyPassMatch \"^\/(.*)\/ws$\" \"ws:\/\/192.168.1.100:8080\/websocket\/$1\"\n    # E\u011fer ProxyPassMatch yerine basit bir ProxyPass kullanmak isterseniz:\n    # ProxyPass \/ws\/ ws:\/\/192.168.1.100:8080\/websocket\/\n    # ProxyPassReverse \/ws\/ ws:\/\/192.168.1.100:8080\/websocket\/\n\n    <Location \/>\n        Require all granted\n    <\/Location>\n<\/VirtualHost><\/code><\/pre>\n<p><code>ProxyPassMatch<\/code> direktifi, d\u00fczenli ifadeler kullanarak daha esnek y\u00f6nlendirmeler sa\u011flar. Burada, URL&#8217;nin bir k\u0131sm\u0131n\u0131 backend yoluna aktarmak i\u00e7in yakalama gruplar\u0131 kullan\u0131lm\u0131\u015ft\u0131r.<\/p>\n<h2>G\u00fcvenlik Hususlar\u0131<\/h2>\n<p>Ters vekil sunucusu, web altyap\u0131n\u0131z\u0131n \u00f6n cephesi oldu\u011fu i\u00e7in g\u00fcvenlik kritik \u00f6neme sahiptir.<\/p>\n<p>*   <strong><code>ProxyRequests Off<\/code>:<\/strong> Bu direktifin her zaman <code>Off<\/code> olarak ayarland\u0131\u011f\u0131ndan emin olun. Aksi takdirde, sunucunuz bir a\u00e7\u0131k vekil sunucusu (open proxy) haline gelebilir ve spam g\u00f6nderimi veya di\u011fer k\u00f6t\u00fc niyetli faaliyetler i\u00e7in kullan\u0131labilir.<br \/>\n*   <strong>Eri\u015fim Kontrol\u00fc:<\/strong> <code><Location><\/code> veya <code><Directory><\/code> bloklar\u0131 i\u00e7inde <code>Require all denied<\/code>, <code>Require ip<\/code> gibi direktifler kullanarak ters vekil sunucunuza veya belirli arka u\u00e7 yollar\u0131na kimlerin eri\u015febilece\u011fini k\u0131s\u0131tlay\u0131n. \u00d6rne\u011fin, y\u00f6netim panelleri i\u00e7in yaln\u0131zca belirli IP adreslerinden eri\u015fime izin verin.<br \/>\n*   <strong>SSL\/TLS Kullan\u0131m\u0131:<\/strong> Her zaman HTTPS kullan\u0131n. G\u00fc\u00e7l\u00fc \u015fifreleme algoritmalar\u0131 ve TLS 1.2 veya 1.3 gibi modern protokoller kullan\u0131n. Eski ve zay\u0131f \u015fifrelemeleri devre d\u0131\u015f\u0131 b\u0131rak\u0131n.<br \/>\n*   <strong>HTTP Ba\u015fl\u0131klar\u0131n\u0131n Y\u00f6netimi (<code>mod_headers<\/code>):<\/strong><br \/>\n    *   <code>X-Forwarded-For<\/code>, <code>X-Forwarded-Proto<\/code>, <code>X-Forwarded-Host<\/code> gibi ba\u015fl\u0131klar\u0131 arka uca iletin. Bu, arka u\u00e7 uygulamalar\u0131n\u0131n istemcinin ger\u00e7ek IP adresini, protokol\u00fcn\u00fc ve alan ad\u0131n\u0131 bilmesini sa\u011flar. <code>ProxyPreserveHost On<\/code> bu ba\u015fl\u0131klar\u0131 otomatik olarak ayarlar.<br \/>\n    *   Hassas bilgileri if\u015fa edebilecek sunucu ba\u015fl\u0131klar\u0131n\u0131 (<code>Server<\/code>, <code>X-Powered-By<\/code>) kald\u0131r\u0131n veya de\u011fi\u015ftirin.<br \/>\n    *   G\u00fcvenlik ba\u015fl\u0131klar\u0131 ekleyin (\u00f6rne\u011fin, <code>Strict-Transport-Security<\/code>, <code>Content-Security-Policy<\/code>, <code>X-Content-Type-Options<\/code>, <code>X-Frame-Options<\/code>).<br \/>\n*   <strong>Arka U\u00e7 Sunucular\u0131na Do\u011frudan Eri\u015fimi Engelleme:<\/strong> G\u00fcvenlik duvar\u0131n\u0131zda (UFW veya ba\u015fka bir firewall) arka u\u00e7 sunucular\u0131n\u0131z\u0131n portlar\u0131na yaln\u0131zca ters vekil sunucusunun IP adresinden eri\u015fime izin verin. Do\u011frudan internetten eri\u015fimi engelleyin.<br \/>\n*   <strong>Web Uygulama G\u00fcvenlik Duvar\u0131 (WAF):<\/strong> ModSecurity gibi bir WAF entegre ederek yayg\u0131n web sald\u0131r\u0131lar\u0131na (SQL enjeksiyonu, XSS vb.) kar\u015f\u0131 ek bir koruma katman\u0131 sa\u011flayabilirsiniz.<br \/>\n*   <strong>G\u00fcnl\u00fck Kayd\u0131 ve \u0130zleme:<\/strong> Eri\u015fim ve hata g\u00fcnl\u00fcklerini d\u00fczenli olarak izleyin. Anormal trafik veya hata desenleri g\u00fcvenlik sorunlar\u0131na i\u015faret edebilir.<\/p>\n<h2>Sorun Giderme ve \u0130pu\u00e7lar\u0131<\/h2>\n<p>Ters vekil yap\u0131land\u0131rmalar\u0131nda sorunlarla kar\u015f\u0131la\u015fmak yayg\u0131nd\u0131r. \u0130\u015fte baz\u0131 sorun giderme ipu\u00e7lar\u0131:<\/p>\n<p>*   <strong>Apache Hata G\u00fcnl\u00fckleri:<\/strong> En \u00f6nemli kaynak <code>\/var\/log\/apache2\/error.log<\/code> dosyas\u0131d\u0131r. Herhangi bir yap\u0131land\u0131rma hatas\u0131, mod\u00fcl y\u00fckleme sorunu veya vekil y\u00f6nlendirme problemi burada detayl\u0131 olarak kaydedilir.<br \/>\n*   <strong>Eri\u015fim G\u00fcnl\u00fckleri:<\/strong> <code>\/var\/log\/apache2\/access.log<\/code> dosyas\u0131, istemci isteklerinin ve Apache&#8217;nin bunlara nas\u0131l yan\u0131t verdi\u011finin bir kayd\u0131n\u0131 tutar. \u0130steklerin arka uca ula\u015f\u0131p ula\u015fmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in faydal\u0131d\u0131r.<br \/>\n*   <strong>Yap\u0131land\u0131rma S\u00f6zdizimi Kontrol\u00fc:<\/strong> Herhangi bir de\u011fi\u015fiklik yapt\u0131ktan sonra <code>sudo apachectl configtest<\/code> komutunu \u00e7al\u0131\u015ft\u0131rmay\u0131 unutmay\u0131n. Bu, Apache&#8217;yi yeniden ba\u015flatmadan \u00f6nce s\u00f6zdizimi hatalar\u0131n\u0131 yakalar.<br \/>\n*   <strong><code>LogLevel debug<\/code>:<\/strong> Daha ayr\u0131nt\u0131l\u0131 g\u00fcnl\u00fck kayd\u0131 i\u00e7in, sanal ana bilgisayar\u0131n\u0131z\u0131n veya genel Apache yap\u0131land\u0131rman\u0131z\u0131n i\u00e7ine <code>LogLevel debug<\/code> ekleyebilirsiniz. Bu, <code>mod_proxy<\/code>&#8216;nin ne yapt\u0131\u011f\u0131n\u0131 anlamak i\u00e7in \u00e7ok faydal\u0131 olabilir, ancak \u00fcretim ortam\u0131nda bu seviyeyi kapatmay\u0131 unutmay\u0131n \u00e7\u00fcnk\u00fc \u00e7ok fazla g\u00fcnl\u00fck \u00fcretir.<br \/>\n*   <strong>Firewall (UFW):<\/strong> Sunucunuzun g\u00fcvenlik duvar\u0131n\u0131n (UFW) Apache i\u00e7in gelen 80 (HTTP) ve 443 (HTTPS) portlar\u0131na izin verdi\u011finden emin olun. Ayr\u0131ca, ters vekil sunucusunun arka u\u00e7 sunucular\u0131n\u0131n portlar\u0131na eri\u015fmesine izin verildi\u011finden emin olun.<\/p>\n<pre><code class=\"language-bash\">sudo ufw allow 'Apache Full'\n    sudo ufw allow out to 192.168.1.100 port 8080 # Arka u\u00e7 portu i\u00e7in \u00f6rnek\n    sudo ufw enable<\/code><\/pre>\n<p>*   <strong>Arka U\u00e7 Sunucusu Durumu:<\/strong> Arka u\u00e7 sunucunuzun \u00e7al\u0131\u015ft\u0131\u011f\u0131ndan ve do\u011fru portu dinledi\u011finden emin olun. Arka u\u00e7 sunucunuzun g\u00fcnl\u00fcklerini kontrol edin.<br \/>\n*   <strong>SELinux\/AppArmor:<\/strong> E\u011fer sunucunuzda SELinux veya AppArmor gibi g\u00fcvenlik mekanizmalar\u0131 etkinse, Apache&#8217;nin \u00f6nbellek dizinine yazma veya a\u011f ba\u011flant\u0131lar\u0131 kurma izinleri engelleniyor olabilir. Bu durumda ilgili politikalara izin eklemeniz gerekebilir.<br \/>\n*   <strong>Taray\u0131c\u0131 \u00d6nbelle\u011fi:<\/strong> Test yaparken taray\u0131c\u0131 \u00f6nbelle\u011finizin temiz oldu\u011fundan veya gizli sekme (incognito mode) kulland\u0131\u011f\u0131n\u0131zdan emin olun. Taray\u0131c\u0131lar eski i\u00e7eri\u011fi \u00f6nbellekten servis edebilir.<br \/>\n*   <strong><code>curl<\/code> Komutu:<\/strong> Komut sat\u0131r\u0131ndan <code>curl -v http:\/\/example.com<\/code> veya <code>curl -v https:\/\/example.com<\/code> kullanarak HTTP ba\u015fl\u0131klar\u0131n\u0131 ve y\u00f6nlendirmeleri detayl\u0131 bir \u015fekilde inceleyebilirsiniz. Bu, \u00f6zellikle <code>ProxyPassReverse<\/code>&#8216;in do\u011fru \u00e7al\u0131\u015f\u0131p \u00e7al\u0131\u015fmad\u0131\u011f\u0131n\u0131 kontrol etmek i\u00e7in faydal\u0131d\u0131r.<\/p>\n<h2>Sonu\u00e7<\/h2>\n<p>Bu makalede, Apache HTTP Sunucusu&#8217;nu Ubuntu 20.04 \u00fczerinde <code>mod_proxy<\/code> mod\u00fcl\u00fc arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7l\u00fc ve esnek bir ters vekil sunucusu olarak nas\u0131l yap\u0131land\u0131raca\u011f\u0131m\u0131z\u0131 detayl\u0131 bir \u015fekilde inceledik. Temel kurulumdan ba\u015flayarak, URL tabanl\u0131 y\u00f6nlendirme, SSL\/TLS sonland\u0131rma, y\u00fck dengeleme, \u00f6nbellekleme ve WebSocket deste\u011fi gibi geli\u015fmi\u015f yap\u0131land\u0131rmalar\u0131 ad\u0131m ad\u0131m \u00f6\u011frendik. Ayr\u0131ca, ters vekil sunucusu kullan\u0131rken dikkat edilmesi gereken \u00f6nemli g\u00fcvenlik hususlar\u0131na ve yayg\u0131n sorun giderme ipu\u00e7lar\u0131na da de\u011findik.<\/p>\n<p>Apache&#8217;nin <code>mod_proxy<\/code> mod\u00fcl\u00fc, modern web altyap\u0131lar\u0131n\u0131n karma\u015f\u0131k gereksinimlerini kar\u015f\u0131lamak i\u00e7in geni\u015f bir yetenek yelpazesi sunar. G\u00fcvenli\u011fi art\u0131rma, performans\u0131 optimize etme ve uygulamalar\u0131n\u0131z\u0131n \u00f6l\u00e7eklenebilirli\u011fini sa\u011flama konusunda kritik bir rol oynar. Bu k\u0131lavuzdaki bilgilerle, kendi \u00f6zel ihtiya\u00e7lar\u0131n\u0131za g\u00f6re Apache&#8217;yi bir ters vekil sunucusu olarak g\u00fcvenle yap\u0131land\u0131rabilecek ve y\u00f6netebileceksiniz. Web sunucusu mimarinizi daha sa\u011flam, verimli ve g\u00fcvenli hale getirmek i\u00e7in Apache&#8217;nin bu g\u00fc\u00e7l\u00fc \u00f6zelli\u011finden tam olarak yararlanman\u0131z\u0131 \u00f6neririz. Gelecekte, daha fazla \u00f6zellik ve mod\u00fcl\u00fc ke\u015ffederek Apache ters vekil sunucunuzun yeteneklerini geni\u015fletebilirsiniz.<\/body><\/p>\n","protected":false},"excerpt":{"rendered":"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma\nGiri\u015f\nG\u00fcn\u00fcm\u00fcz\u00fcn karma\u015f\u0131k web uygulamalar\u0131 ve mikroservis m","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_page_header_type":"","csco_page_load_nextpost":"","csco_page_subscribe_form":"","csco_page_contact_form":"","footnotes":""},"categories":[1468],"tags":[],"class_list":{"0":"post-38722","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-ubuntu","7":"cs-entry","8":"cs-video-wrap"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.5 (Yoast SEO v25.3.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apache&#039;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache&#039;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma\" \/>\n<meta property=\"og:description\" content=\"Apache&#039;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma Giri\u015f G\u00fcn\u00fcm\u00fcz\u00fcn karma\u015f\u0131k web uygulamalar\u0131 ve mikroservis m\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\" \/>\n<meta property=\"og:site_name\" content=\"Kodlar\u0131n Gizemli D\u00fcnyas\u0131\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-06T08:40:50+00:00\" \/>\n<meta name=\"author\" content=\"Fatih Soysal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatih Soysal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\"},\"author\":{\"name\":\"Fatih Soysal\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"headline\":\"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma\",\"datePublished\":\"2026-02-06T08:40:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\"},\"wordCount\":2792,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"articleSection\":[\"Ubuntu\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#respond\"]}],\"copyrightYear\":\"2026\",\"copyrightHolder\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\",\"name\":\"Apache'yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131\",\"isPartOf\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\"},\"datePublished\":\"2026-02-06T08:40:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Anasayfa\",\"item\":\"https:\/\/fatihsoysal.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#website\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/\",\"name\":\"Fatihsoysal.com\",\"description\":\"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim\",\"publisher\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1\",\"name\":\"Fatih Soysal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"contentUrl\":\"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png\",\"width\":512,\"height\":512,\"caption\":\"Fatih Soysal\"},\"logo\":{\"@id\":\"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.\",\"url\":\"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Apache'yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/","og_locale":"tr_TR","og_type":"article","og_title":"Apache'yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma","og_description":"Apache'yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma Giri\u015f G\u00fcn\u00fcm\u00fcz\u00fcn karma\u015f\u0131k web uygulamalar\u0131 ve mikroservis m","og_url":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/","og_site_name":"Kodlar\u0131n Gizemli D\u00fcnyas\u0131","article_published_time":"2026-02-06T08:40:50+00:00","author":"Fatih Soysal","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Fatih Soysal","Tahmini okuma s\u00fcresi":"19 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#article","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/"},"author":{"name":"Fatih Soysal","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"headline":"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma","datePublished":"2026-02-06T08:40:50+00:00","mainEntityOfPage":{"@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/"},"wordCount":2792,"commentCount":0,"publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"articleSection":["Ubuntu"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#respond"]}],"copyrightYear":"2026","copyrightHolder":{"@id":"https:\/\/fatihsoysal.com\/blog\/#organization"}},{"@type":"WebPage","@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/","url":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/","name":"Apache'yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma - Kodlar\u0131n Gizemli D\u00fcnyas\u0131","isPartOf":{"@id":"https:\/\/fatihsoysal.com\/blog\/#website"},"datePublished":"2026-02-06T08:40:50+00:00","breadcrumb":{"@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/fatihsoysal.com\/blog\/apacheyi-ubuntu-20-04-uzerinde-mod_proxy-ile-ters-vekil-sunucusu-olarak-kullanma\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Anasayfa","item":"https:\/\/fatihsoysal.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apache&#8217;yi Ubuntu 20.04 \u00dczerinde mod_proxy ile Ters Vekil Sunucusu Olarak Kullanma"}]},{"@type":"WebSite","@id":"https:\/\/fatihsoysal.com\/blog\/#website","url":"https:\/\/fatihsoysal.com\/blog\/","name":"Fatihsoysal.com","description":"Blog - Yaz\u0131l\u0131m D\u00fcnyas\u0131 Tecr\u00fcbelerim","publisher":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fatihsoysal.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/002a254750921dcfd568a99e48240dd1","name":"Fatih Soysal","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","contentUrl":"https:\/\/fatihsoysal.com\/blog\/wp-content\/uploads\/2024\/04\/cropped-replicate-prediction-3kgg1hgjn5rgp0cf0p5tr0jw7w-1.png","width":512,"height":512,"caption":"Fatih Soysal"},"logo":{"@id":"https:\/\/fatihsoysal.com\/blog\/#\/schema\/person\/image\/"},"description":"Kullan\u0131m ve kodlama m\u00fckemmeliyetini odak alan uygulamalar olu\u015fturma deneyimine sahip, profesyonel olarak 15+ y\u0131l \u00fczeri deneyime sahip bir yaz\u0131l\u0131m m\u00fchendisi.","url":"https:\/\/fatihsoysal.com\/blog\/author\/fatihsoysal\/"}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/38722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/comments?post=38722"}],"version-history":[{"count":1,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/38722\/revisions"}],"predecessor-version":[{"id":38723,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/posts\/38722\/revisions\/38723"}],"wp:attachment":[{"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/media?parent=38722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/categories?post=38722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatihsoysal.com\/blog\/wp-json\/wp\/v2\/tags?post=38722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}