1 |
On 6/30/07, Christoph Erdle <chris@××××××××××.de> wrote: |
2 |
> Hi, |
3 |
> |
4 |
> I encountered a really annoying behavior of eccelerator. |
5 |
> |
6 |
> On my server I run several installs of wordpress using gentoo's |
7 |
> webapp-config, all up to the same version. When the cache is empty |
8 |
> all works as expected, it caches the called php pages. BUT when I |
9 |
> access a different install of wordpress I get the sites that were |
10 |
> cached for the installation i accessed before. |
11 |
> |
12 |
> In the log of eaccelerator I see that the hits are for the wrong |
13 |
> locations on the file system, it seems that eaccelerator only caches |
14 |
> an checksum of the files accessed but not their actual path. E.g. all |
15 |
> index.php for all wordpress installs are the same, as they are |
16 |
> installed via webapp-config, and the cache hits for the first one |
17 |
> accessed. |
18 |
> |
19 |
> Are there any possibilities getting eaccelerator to run on a vhost |
20 |
> environment? |
21 |
> |
22 |
> Any help appreciated, |
23 |
> Steelynose |
24 |
> |
25 |
> -- |
26 |
> Solidarität ist die Zärtlichkeit der Völker. (Ernesto Che Guevara) |
27 |
> |
28 |
> |
29 |
|
30 |
You could just mass modify the php scripts so the checksums don't fire the same. |
31 |
|
32 |
If you get desperate for answers : |
33 |
|
34 |
---------------------------------------------------------------------- |
35 |
#!/usr/bin/ruby |
36 |
# |
37 |
# |
38 |
# |
39 |
# turns ?> in all files in the current directory with .php |
40 |
# to /*random:BYTESHERE:*/?> |
41 |
# we replace the closing tag instead of the opening cos the opening might |
42 |
# be <?php instead and we dont want to break stuff |
43 |
# |
44 |
def randomBytes() |
45 |
bchars = %w{1 2 3 4 5 6 7 8 9 A B C D E F} |
46 |
bcount = bchars.length |
47 |
output = "" |
48 |
10.times{ |z| |
49 |
output << bchars[(rand * bcount-1).round] |
50 |
} |
51 |
return output |
52 |
end |
53 |
|
54 |
|
55 |
|
56 |
# Foreach PHP File |
57 |
Dir::glob("**/*.php"){ |x| |
58 |
# if already backed up, do nothing |
59 |
unless FileTest::exists?("#{x}.bak") |
60 |
output = [] |
61 |
#backup |
62 |
`cp "#{x}" "#{x}.bak"` |
63 |
#read file |
64 |
input =File.new("#{x}", "r" ) |
65 |
input.each_line{ |line| |
66 |
output.push(line.gsub(/\?\>/, "/*random:" + randomBytes() + ":*/?>" )) |
67 |
} |
68 |
input.close; |
69 |
#write file |
70 |
replace = File.new("#{x}","w") |
71 |
output.each{ |x| |
72 |
replace.puts(x); |
73 |
} |
74 |
replace.close |
75 |
end |
76 |
|
77 |
} |
78 |
------------------------------------------------------------------------------------- |
79 |
|
80 |
-- |
81 |
Kent |
82 |
ruby -e '[1, 2, 4, 7, 0, 9, 5, 8, 3, 10, 11, 6, 12, 13].each{|x| |
83 |
print "enNOSPicAMreil kdrtf@×××.com"[(2*x)..(2*x+1)]}' |
84 |
-- |
85 |
gentoo-user@g.o mailing list |