sebelumnya yang ingin tau apa itu varnish silakan kesini
[You must be registered and logged in to see this link.]Kali ini ane bakalan ngasih tutor tentang bagaimana cara install varnish di web server. Gunanya adalah biar nantinya website ente-ente bisa cepet kaya DC ini.!!! mantap
1. Download Varnish & libvarnishnya di website resmi debian
[You must be registered and logged in to see this link.]2. Install varnish & libvarnishnya
root@blackexe:/home/sandimulyadi/Downloads# dpkg -i libvarnish1_2.1.3-8_i386.deb
root@blackexe:/home/sandimulyadi/Downloads# dpkg -i varnish_2.1.3-8_i386.deb
3. Setting varnishnya
root@blackexe:/home/sandimulyadi/Downloads# nano /etc/default/varnish
Cari script seperti dibawah ini dan rubah seperti ini
Quote:START=yes
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/sandi.vcl \
-S /etc/varnish/secret \
-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
4. Buat sandi.vcl nya
root@blackexe:/home/sandimulyadi/Downloads# cd /etc/varnish
root@blackexe:/etc/varnish# ls
default.vcl secret
root@blackexe:/etc/varnish# cp default.vcl sandi.vcl
5. Lakukan konfigurasi pada sandi.vcl ubah scriptnya menjadi seperti dibawah ini
root@blackexe:/etc/varnish# nano sandi.vcl
backend default {
.host = "127.0.0.1";
.port = "8000";
6. Lakukan konfigurasi pada ports.conf di apache2
root@blackexe:/etc/varnish# nano /etc/apache2/ports.conf
NameVirtualHost *:8000
Listen 127.0.0.1:8000
7. Ubah semua VHost (Virtual Host) yang tadinya <VirtualHost*:80> menjadi <VirtualHost *:8000>
8. Install paket tambahan
root@blackexe:/etc/varnish# cd /home/sandimulyadi/Downloads
root@blackexe:/home/sandimulyadi/Downloads# dpkg -i libapache2-mod-rpaf_0.5-3_i386.deb
9. Lakukan restart pada apache2
root@blackexe:/home/sandimulyadi/Downloads# /etc/init.d/apache2 restart
10. Cek konfigurasi
root@blackexe:/home/sandimulyadi/Downloads# netstat -lp | grep apache2
tcp 0 0 localhost:8000 *:* LISTEN 6256/apache2
11. Restart Varnish
root@blackexe:/home/sandimulyadi/Downloads# /etc/init.d/varnish restart
12. Cek konfigurasi
root@blackexe:/home/sandimulyadi/Downloads# netstat -lp | grep varnish
tcp 0 0 *:www *:* LISTEN 6454/varnishd
tcp 0 0 localhost:6082 *:* LISTEN 6453/varnishd
tcp6 0 0 [::]:www [::]:* LISTEN 6454/varnishd
Kesimpulan yang harus di download terlebih dahulu :
1. libvarnish1_2.1.3-8_i386.deb
2. varnish_2.1.3-8_i386.deb
3. libapache2-mod-rpaf_0.5-3_i386.deb
Semuanya itu dapat di download di alamat
[You must be registered and logged in to see this link.]Cek di web browser apakah kecepatannya sudah bertambah cepat ato belom.,