Varnish

提供: Amayus Wiki
Jump to navigation Jump to search

リンク[編集]

前提[編集]

$ sudo apt install python-docutils python-sphinx okg-config libreadline-dev libncurses5-dev libncursesw5-dev
$ sudo yum install python-docutils python-sphinx readline-devel

インストール[編集]

$ wget https://varnish-cache.org/_downloads/varnish-6.1.1.tgz
$ tar xf varnish-6.1.1.tgz
$ cd varnish-6.1.1
$ export PCRE_LIBS="-L/opt/pcre-8.42/lib -lpcre"
$ export PCRE_CFLAGS="-I/opt/pcre-8.42/include"
$ ./configure --prefix=/opt/varnish-6.1.1
$ make -j2
$ make check
$ make install

サービス化[編集]

$ sudo groupadd varnish
$ sudo useradd -g varnish -s /sbin/nologin varnish
$ sudo vi /etc/systemd/system/varnish.service
[Unit]
Description=Web Application Accelerator
After=network.target

[Service]
ExecStart=/opt/varnish/sbin/varnishd -a 0.0.0.0:81,PROXY -f /etc/opt/varnish/default.vcl -T localhost:6082 -s malloc,256M -F -p feature=+http2

[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ systemctl status varnish
$ sudo systemctl start varnish
$ systemctl status varnish
$ sudo systemctl stop varnish
$ systemctl status varnish
$ sudo systemctl start varnish
$ sudo systemctl enable varnish
$ systemctl status varnish

メモ[編集]

  • TLSをしゃべるにはHitchが必要らしい。Varnish Cache Plus は対応している?