Installing Varnish from the Source Code
|
Software Version |
Whether to Support CentOS 7.6 |
Whether to Support CentOS 8.1 |
Whether to Support openEuler 20.03 (LTS-SP1) |
|---|---|---|---|
|
Varnish 6.2.0 |
Yes |
No |
Yes |
|
Varnish 6.5.1 |
No |
Yes |
No |
In the following commands, x.x.x indicates the Varnish version.
Obtaining the Source Code
- Download the Varnish source code package using the local browser.
- Copy the source code to the /home directory on the server.
If the server is connected to the Internet, you can run the wget command on the server to download the source code.
1cd /home
1wget https://varnish-cache.org/_downloads/varnish-x.x.x.tgz --no-check-certificate
Compiling and Installing Varnish
- Go to the home directory.
1cd /home/
- Decompress the source code package.
1tar -zxvf varnish-x.x.x.tgz
- Go to the source code directory.
1cd /home/varnish-x.x.x/
- Perform automatic compilation.
1sh autogen.sh - Check the dependency.
1./configure --prefix=/usr/local/varnish

--prefix=PATH: specifies the Varnish installation directory.
- Compile and install Varnish.
1make -j60 && make install
Configuration File
- Create a folder in the Varnish installation path for storing the configuration file.
1cd /usr/local/varnish && mkdir config
- Copy the configuration file to the config directory.
1cp /usr/local/varnish/share/doc/varnish/example.vcl /usr/local/varnish/config/default.vcl
Parent topic: Installing Varnish