{"id":938,"date":"2022-09-09T16:59:06","date_gmt":"2022-09-09T16:59:06","guid":{"rendered":"https:\/\/sunucucozumleri.com\/?p=938"},"modified":"2022-10-09T19:14:19","modified_gmt":"2022-10-09T19:14:19","slug":"centos-plesk-sunucuya-varnish-cache-kurulumu","status":"publish","type":"post","link":"https:\/\/sunucucozumleri.com\/blog\/centos-plesk-sunucuya-varnish-cache-kurulumu\/","title":{"rendered":"Centos Plesk Sunucuya Varnish Cache Kurulumu"},"content":{"rendered":"<p>Merhabalar,<br \/>\nMakalemizde Varnish Cache Nedir, Varnish Kurulumu, Varnish Optimizasyonu, Varnish Ayarlar\u0131, Plesk Konfig\u00fcrasyonu konular\u0131na de\u011finece\u011fiz.<\/p>\n<p><strong>Varnish Cache Nedir ?<\/strong><\/p>\n<p><strong>Varnish<\/strong>\u00a0basit\u00e7e, yap\u0131lan istekleri, belli kurallar ile \u00f6nbelle\u011fe al\u0131p, istemciye d\u00f6nen, genelde web sunucular\u0131n \u00f6n\u00fcnde konumland\u0131r\u0131lan servistir. \u0130stekler Varnish\u2019e geliyor, Varnish \u00f6nbelle\u011finde varsa iste\u011fi buradan d\u00f6n\u00fcyor, e\u011fer yoksa \u201cbackend\u201dden fetch ediyor.<\/p>\n<p>\u0130stekler Varnish\u2019e gelir \u00f6nbelle\u011finde varsa d\u00f6ner yoksa web sunucusuna gider \u00f6nbelle\u011fine al\u0131r ve buradan isteklere cevap vermeye devam eder. Ayn\u0131 zamanda Load Balancer g\u00f6revi de g\u00f6r\u00fcr. Olduk\u00e7a esnektir. vcl denilen, javascript syntax\u2019\u0131na yak\u0131n bir dil ile gerekli ayarlamalar\u0131 yap\u0131lmaktad\u0131r.Facebook\u2019un da kulland\u0131\u011f\u0131 bir teknolojidir.<\/p>\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/fGD14ChpcL4\" width=\"560\" height=\"315\" frameborder=\"0\" data-mce-fragment=\"1\"><\/iframe><\/p>\n<p><strong>Centos Plesk Panel&#8217;e Varnish Cache Kurulumu<\/strong><\/p>\n<p>\u00d6ncelikle yapmam\u0131z gereken Apache portunu de\u011fi\u015ftirmek olacakt\u0131r.<\/p>\n<pre>mysql -uadmin -p$(cat \/etc\/psa\/.psa.shadow) -D psa -e'replace into misc (param, val) values (\"http_port\", 8088);'\r\n\/usr\/local\/psa\/admin\/bin\/httpdmng --reconfigure-all\r\n<\/pre>\n<p>Apache portunu \u00f6rnekteki uygulamada 8088 olarak de\u011fi\u015ftirdik. Sizlerde kendinize g\u00f6re bir port belirtebilirsiniz.<\/p>\n<pre>nano -w \/etc\/httpd\/conf\/httpd.conf\r\n<\/pre>\n<p>httpd.conf dosyas\u0131 i\u00e7erisinde bulunan listen 80 k\u0131sm\u0131n\u0131 de\u011fi\u015ftirmi\u015f oldu\u011fumuz port numaras\u0131n\u0131 yazal\u0131m.<\/p>\n<pre>wget https:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/jemalloc-3.6.0-1.el6.x86_64.rpm\r\nrpm -ivv --force jemalloc-3.6.0-1.el6.x86_64.rpm\r\n<\/pre>\n<p>&nbsp;<\/p>\n<pre>yum update -y\r\nyum clean all -y\r\ncat &lt;&lt; EOF &gt;&gt; \/etc\/yum.repos.d\/varnish.repo\r\n[varnish]\r\nname=Varnish for Enterprise Linux 6\r\nbaseurl=https:\/\/repo.varnish-cache.org\/redhat\/varnish-4.0\/el6\/\r\nenabled=1\r\ngpgkey=https:\/\/repo.varnish-cache.org\/GPG-key.txt\r\ngpgcheck=1\r\nEOF\r\n<\/pre>\n<pre>yum install -y varnish\r\n<\/pre>\n<p><strong>Varnish Kontrol\u00fcn\u00fc Ger\u00e7ekle\u015ftirelim.<\/strong><\/p>\n<pre>service varnish status\r\nvarnishd -V\r\n<\/pre>\n<p><strong>Varnish Optimizasyonu ve Ayarlar\u0131<\/strong><\/p>\n<pre>nano -w \/etc\/sysconfig\/varnish\r\n<\/pre>\n<p>&nbsp;<\/p>\n<pre>## Alternative 3, Advanced configuration\r\n#\r\n# See varnishd(1) for more information.\r\n#\r\n# # Main configuration file. You probably want to change it :)\r\nVARNISH_VCL_CONF=\/etc\/varnish\/default.vcl\r\n#\r\n# # Default address and port to bind to\r\n# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify\r\n# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.\r\n# VARNISH_LISTEN_ADDRESS=\r\nVARNISH_LISTEN_PORT=80\r\n#\r\n# # Telnet admin interface listen address and port\r\nVARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1\r\nVARNISH_ADMIN_LISTEN_PORT=6082\r\n#\r\n# # Shared secret file for admin interface\r\nVARNISH_SECRET_FILE=\/etc\/varnish\/secret\r\n#\r\n# # The minimum number of worker threads to start\r\nVARNISH_MIN_THREADS=50\r\n#\r\n# # The Maximum number of worker threads to start\r\nVARNISH_MAX_THREADS=1000\r\n#\r\n# # Idle timeout for worker threads\r\nVARNISH_THREAD_TIMEOUT=120\r\n#\r\n# # Cache file size: in bytes, optionally using k \/ M \/ G \/ T suffix,\r\n# # or in percentage of available disk space using the % suffix.\r\nVARNISH_STORAGE_SIZE=256M\r\n#\r\n# # Backend storage specification\r\nVARNISH_STORAGE=\"malloc,${VARNISH_STORAGE_SIZE}\"\r\n#\r\n# # Default TTL used when the backend does not specify one\r\nVARNISH_TTL=120\r\n#\r\n# # DAEMON_OPTS is used by the init script.  If you add or remove options, make\r\n# # sure you update this section, too.\r\nDAEMON_OPTS=\"-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \\\r\n             -f ${VARNISH_VCL_CONF} \\\r\n             -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \\\r\n             -t ${VARNISH_TTL} \\\r\n             -p thread_pool_min=${VARNISH_MIN_THREADS} \\\r\n             -p thread_pool_max=${VARNISH_MAX_THREADS} \\\r\n             -p thread_pool_timeout=${VARNISH_THREAD_TIMEOUT} \\\r\n             -u varnish -g varnish \\\r\n             -S ${VARNISH_SECRET_FILE} \\\r\n             -s ${VARNISH_STORAGE}\"\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<pre>chkconfig --add varnish\r\nchkconfig varnish on\r\n\r\n<\/pre>\n<p><strong>Varnish Cache Komutlar\u0131<\/strong><\/p>\n<pre>varnishlog \u2013 Varnish Loglar\u0131n\u0131 Listeler\r\nvarnishhist \u2013 Varnish \u0130steklerini Listeler\r\nvarnishstat \u2013 Varnish \u0130statistikleri\r\nvarnishtop \u2013 Varnish Log \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Merhabalar, Makalemizde Varnish Cache Nedir, Varnish Kurulumu, Varnish Optimizasyonu, Varnish Ayarlar\u0131, Plesk Konfig\u00fcrasyonu konular\u0131na de\u011finece\u011fiz. Varnish Cache Nedir ? Varnish\u00a0basit\u00e7e, yap\u0131lan istekleri, belli kurallar ile \u00f6nbelle\u011fe al\u0131p, istemciye d\u00f6nen, genelde web sunucular\u0131n \u00f6n\u00fcnde konumland\u0131r\u0131lan servistir. \u0130stekler Varnish\u2019e geliyor, Varnish \u00f6nbelle\u011finde varsa iste\u011fi buradan d\u00f6n\u00fcyor, e\u011fer yoksa \u201cbackend\u201dden fetch ediyor. \u0130stekler Varnish\u2019e gelir \u00f6nbelle\u011finde varsa d\u00f6ner &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-938","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":0,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media\/1456"}],"wp:attachment":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}