varnish圖片快取服務器安裝

來源:互聯網
上載者:User

標籤:varnish圖片快取服務器安裝

OS:Centos 5.7

Kerlnel: 2.6.18-274.el5

Varnish server IP:10.10.8.69

Apache 後端伺服器

 

1 下載varnish

https://www.varnish-cache.org/releases

2準備工作,需先安裝以下包

automake

autoconf

libtool

ncurses-devel

libxslt

groff

pcre-devel

pkgconfig

 三,建立啟動使用者和日誌目錄

 

usrsbingroupadd www -g 48

usrsbinuseradd -u 48 -g www www

mkdir -p varvcache

chmod +w varvcache

chown -R wwwwww varvcache

mkdir -p varlogvarnish

chmod +w varlogvarnish

chown -R wwwwww varlogvarnish

 

四,安裝varnish

 

tar zxvf varnish-3.0.0.tar.gz

cd varnish-3.0.0

./configure --prefix=/usr/local/varnish

make

make install

 

五,配置varnish

 

vi /usr/local/varnish/etc/varnish/default.vcl

backend default {

     .host = "10.10.8.73";

     .port = "80";

}

註:10.10.8.73為後端apache 伺服器

 

六,啟動varnish

 

/usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/varnish/default.vcl -a 0.0.0.0:80 -s file,/var/vcache/varnish_cache.data,4G -u www -w 30000,51200,10 -T 127.0.0.1:3500

 

-f 指定設定檔

-a 0.0.0.0:80 指定監聽連接埠

-T 127.0.0.1:2000 設定管理連接埠

-s file,/data1/vcache,80g 虛擬記憶體檔案對應類型,路徑以及容量.

包括兩種類型"malloc"和"file"

-s malloc,1G  #malloc是記憶體+swap交換模式.很簡單.沒得說.

-s file,/data3/vcache,80g  #file是mmap的檔案記憶體映射機制.


本文出自 “我是一隻小小鳥” 部落格,請務必保留此出處http://2242558.blog.51cto.com/2232558/1545337

varnish圖片快取服務器安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.