summaryrefslogtreecommitdiffabout
path: root/README
authorSergey Poznyakoff <gray@gnu.org.ua>2017-08-05 16:50:12 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-08-05 17:06:29 (GMT)
commite0e3166a8bbe666414c2f0ee9c732f6254acf550 (patch) (side-by-side diff)
treead71f730234762a83f461ff85a427fd591fa9460 /README
parentaa3bfb206b14da4de737394d73098fb069b3d8ac (diff)
downloadvmod-dbrw-e0e3166a8bbe666414c2f0ee9c732f6254acf550.tar.gz
vmod-dbrw-e0e3166a8bbe666414c2f0ee9c732f6254acf550.tar.bz2
Switch to new acvmod. Remove the --with-varnish-source option. Fix the testsuite.
Diffstat (limited to 'README') (more/less context) (ignore whitespace changes)
-rw-r--r--README51
1 files changed, 30 insertions, 21 deletions
diff --git a/README b/README
index 93f6f7e..c4dbbdd 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
Vmod-dbrw README
-Copyright (C) 2013-2014 Sergey Poznyakoff
+Copyright (C) 2013-2017 Sergey Poznyakoff
See the end of file for copying conditions.
* Introduction
@@ -50,12 +50,9 @@ VCL 3.x code:
import dbrw;
- sub vcl_init {
+ sub vcl_recv {
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);
@@ -76,13 +73,10 @@ VCL 4.0 code:
import dbrw;
- 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.config("mysql", "database=dbname;user=varnish;debug=1",
+ "SELECT dest FROM redirects WHERE host='$host' AND url='$url'");
+ set req.http.X-Redirect-To =
dbrw.rewrite("host=" + req.http.Host + ";" +
"url=" + req.url);
if (req.http.X-Redirect-To != "") {
@@ -110,9 +104,9 @@ Table structure:
KEY source (host,url)
)
-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",
{"SELECT dest,pattern,value FROM rewrite
WHERE host='$host' and '$url' like url"});
@@ -120,18 +114,33 @@ VCL code differs only in definition of the vcl_init:
* Installation
-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.
- ./configure --with-varnish-source=/usr/src/varnish-3.0.1
+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 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
* Testing
@@ -237,7 +246,7 @@ Send bug reports and suggestions to <gray@gnu.org>
* Copyright information:
-Copyright (C) 2013-2014 Sergey Poznyakoff
+Copyright (C) 2013-2017 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the

Return to:

Send suggestions and report system problems to the System administrator.