diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-05 19:50:12 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-05 20:21:05 +0300 |
commit | 625b9a4fa3c302715b06fcde8da3544f71cfe8b0 (patch) | |
tree | aa56be3b3129c8bfba769cfc9ec763ee3b1f9b69 /README | |
parent | aa3bfb206b14da4de737394d73098fb069b3d8ac (diff) | |
download | vmod-dbrw-625b9a4fa3c302715b06fcde8da3544f71cfe8b0.tar.gz vmod-dbrw-625b9a4fa3c302715b06fcde8da3544f71cfe8b0.tar.bz2 |
Switch to new acvmod. Remove the --with-varnish-source option. Fix the testsuite.
Diffstat (limited to 'README')
-rw-r--r-- | README | 72 |
1 files changed, 29 insertions, 43 deletions
@@ -1,3 +1,3 @@ Vmod-dbrw README -Copyright (C) 2013-2014 Sergey Poznyakoff +Copyright (C) 2013-2017 Sergey Poznyakoff See the end of file for copying conditions. @@ -48,3 +48,3 @@ The redirection database has the following structure -VCL 3.x code: +The VCL code: @@ -52,35 +52,6 @@ VCL 3.x code: - sub vcl_init { - dbrw.config("mysql", "database=dbname;user=varnish;debug=1", - "SELECT dest FROM redirects WHERE host='$host' AND url='$url'"); - } - sub vcl_recv { - set req.http.X-Redirect-To = - dbrw.rewrite("host=" + req.http.Host + ";" + - "url=" + req.url); - if (req.http.X-Redirect-To != "") { - error(750, "Redirect"); - } - } - - sub vcl_error { - if (obj.status == 750) { - set obj.http.Location = req.http.X-Redirect-To; - set obj.status = 301; - return (deliver); - } - } - -VCL 4.0 code: - - import dbrw; - - sub vcl_init { - dbrw.config("mysql", "database=dbname;user=varnish;debug=1", + dbrw.config("mysql", "database=dbname;user=varnish;debug=1", "SELECT dest FROM redirects WHERE host='$host' AND url='$url'"); - } - - sub vcl_recv { - set req.http.X-Redirect-To = + set req.http.X-Redirect-To = dbrw.rewrite("host=" + req.http.Host + ";" + @@ -112,5 +83,5 @@ Table structure: -VCL code differs only in definition of the vcl_init: +The VCL code differs only in the call to dbrw.config in vcl_recv: - sub vcl_init { + sub vcl_recv { dbrw.config("mysql", "database=varnish;user=varnish;debug=10", @@ -122,14 +93,29 @@ VCL code differs only in definition of the vcl_init: -In order to compile the package you need to have Varnish source tree. -Both Varnish 3.x and 4.x are supported. Supposing that the Varnish -source tree is available under /usr/src/varnish-3.0.1, run: +In order to compile the package you need to have installed +varnishd and varnishapi package. + +Supposing that condition is met, run: + + ./configure + +It should be able to automatically find the necessary components. In case +it doesn't, tweak the configuration variables as necessary. The most +important one is PKG_CONFIG_PATH, which contains a path (in the UNIX sense) +where the .pc files are located. It should contain a directory where the +'varnishapi.pc' file lives. Example usage: - ./configure --with-varnish-source=/usr/src/varnish-3.0.1 + ./configure PKG_CONFIG_PATH=/usr/local/varnish/lib/pkgconfig:$PKG_CONFIG_PATH + +Please read the file INSTALL for a detailed discussion of available variables +and command line options. Once configured, do - + make -This will build the module. Finally, do the following command as root: - +This will build the module. After this step you can optionally run +'make test' to test the package. + +Finally, run the following command as root: + make install @@ -239,3 +225,3 @@ Send bug reports and suggestions to <gray@gnu.org> -Copyright (C) 2013-2014 Sergey Poznyakoff +Copyright (C) 2013-2017 Sergey Poznyakoff |