Changeset 51:de2fd68c1aca in minitage/eggs/minitage.paste
- Timestamp:
- 08/12/08 18:48:54 (5 months ago)
- Author:
- kiorky <kiorky@…>
- Message:
-
0.0.1_alpha34
0.0.1_alpha33
---------------
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r50
|
r51
|
|
| 2 | 2 | CHANGES |
| 3 | 3 | ============== |
| | 4 | 0.0.1_alpha34 |
| | 5 | --------------- |
| | 6 | - fix init script |
| 4 | 7 | |
| 5 | | 0.0.1_alpha29 |
| | 8 | 0.0.1_alpha33 |
| 6 | 9 | --------------- |
| | 10 | - rename varnish binaries |
| | 11 | |
| | 12 | 0.0.1_alpha32 |
| | 13 | --------------- |
| | 14 | - Improve varnish default vcl |
| | 15 | |
| | 16 | 0.0.1_alpha31 |
| | 17 | --------------- |
| | 18 | - Improve varnish default vcl |
| | 19 | |
| | 20 | 0.0.1_alpha30 |
| | 21 | --------------- |
| 7 | 22 | - Improve varnish template |
| 8 | | |
| 9 | 23 | |
| 10 | 24 | 0.0.1_alpha29 |
-
|
r46
|
r51
|
|
| 2 | 2 | source $sys/share/minitage/minitage.env |
| 3 | 3 | export LD_LIBRARY_PATH=$vp/lib/ |
| 4 | | exec $sys/bin/${project}_varnishd \ |
| | 4 | exec $sys/bin/varnishd \ |
| 5 | 5 | -f "$sys/etc/varnish/${project}.vcl" \ |
| 6 | 6 | -P "$sys/var/run/varnish/${project}.pid" \ |
-
|
r46
|
r51
|
|
| 30 | 30 | fi |
| 31 | 31 | if [[ `whoami` == root ]];then |
| 32 | | su \$effectiveuser -c "${sys}/bin/${project}_varnish-instance" |
| | 32 | su \$effectiveuser -c "${sys}/bin/varnish-instance" |
| 33 | 33 | else |
| 34 | | ${sys}/bin/${project}_varnish-instance |
| | 34 | ${sys}/bin/varnish-instance |
| 35 | 35 | fi |
| 36 | 36 | eend \$? |
-
|
r50
|
r51
|
|
| 16 | 16 | |
| 17 | 17 | sub vcl_recv { |
| 18 | | |
| 19 | 18 | /* Purge stuff */ |
| 20 | 19 | if (req.request == "PURGE") { |
| … |
… |
|
| 23 | 22 | } |
| 24 | 23 | lookup; |
| 25 | | } |
| | 24 | } |
| 26 | 25 | |
| 27 | 26 | /* |
| … |
… |
|
| 34 | 33 | #set $host, $port = $host_address.split(':') |
| 35 | 34 | elsif (req.url ~ "^/VirtualHostBase/http/${vhost_vhm}${zope_path}/VirtualHostRoot") { |
| | 35 | /* uncomment this code to unify vhosts if you need to do */ |
| | 36 | // /* first: unify the host header */ |
| | 37 | // if (req.http.host ~ "^.*example.com") { |
| | 38 | // set req.http.host = "example.com"; |
| | 39 | // } |
| | 40 | |
| | 41 | // /* zope specific: unify vhost_vhm url */ |
| | 42 | // set req.url = regsub(req.url, "^/VirtualHostBase/http/${vhost_vhm}", "/VirtualHostBase/http/example.com:80"); |
| | 43 | |
| 36 | 44 | set req.backend = backend_0; |
| 37 | 45 | } |
| … |
… |
|
| 80 | 88 | |
| 81 | 89 | /* handle http compression. */ |
| 82 | | /* |
| 83 | 90 | if (req.http.Accept-Encoding) { |
| 84 | 91 | // Handle compression correctly. Varnish treats headers literally, not |
| … |
… |
|
| 96 | 103 | remove req.http.Accept-Encoding; |
| 97 | 104 | } |
| 98 | | }*/ |
| | 105 | } |
| 99 | 106 | |
| 100 | 107 | if (req.http.Expect) { |
| … |
… |
|
| 136 | 143 | |
| 137 | 144 | sub vcl_hash { |
| 138 | | /* |
| 139 | | * The hash subroutine is important |
| 140 | | * It defines the "name" pattern of |
| 141 | | * cache objects |
| 142 | | * We will use url+host by default. |
| 143 | | * In this way, different machines may |
| 144 | | * share the same cache object. |
| 145 | | */ |
| 146 | 145 | set req.hash += req.url; |
| 147 | | set req.hash += req.http.host; |
| 148 | | |
| 149 | | /* |
| 150 | | * You can also append cookie |
| 151 | | * to the hash. In this way, |
| 152 | | * varnish will fetch/insert a cache object for each |
| 153 | | * machine. |
| 154 | | */ |
| 155 | | if (!(req.url ~ "\.(css|js|png|gif|jpg|jpeg|tiff|doc|odt|pdf|htc)$")) { |
| 156 | | if (req.http.Cookie && req.http.Cookie ~ "_ZopeId" ) { |
| 157 | | set req.hash += req.http.Cookie; |
| 158 | | } |
| | 146 | if (req.http.host) { |
| | 147 | set req.hash += req.http.host; |
| | 148 | } else { |
| | 149 | |
| | 150 | set req.hash += server.ip; |
| 159 | 151 | } |
| 160 | 152 | hash; |
| … |
… |
|
| 162 | 154 | |
| 163 | 155 | sub vcl_fetch { |
| | 156 | |
| | 157 | |
| 164 | 158 | /* Do not store errors in cache, as maybe they will be corrected soon :-) */ |
| 165 | 159 | if (obj.status == 404 || obj.status == 500) { |
| … |
… |
|
| 233 | 227 | insert; |
| 234 | 228 | } |
| | 229 | \# vim: set ft=c: |
| 235 | 230 | #end if |
-
|
r49
|
r51
|
|
| 7 | 7 | |
| 8 | 8 | name='minitage.paste' |
| 9 | | version = '0.0.1_alpha29' |
| | 9 | version = '0.0.1_alpha34' |
| 10 | 10 | |
| 11 | 11 | def read(rnames): |