mod_cache unter Apache 2.4 funktioniert nicht

Alles, was den Apache betrifft, kann hier besprochen werden.

mod_cache unter Apache 2.4 funktioniert nicht

Postby halbsodoppelt » 07. May 2014 09:06

Hallo miteinander,



ich habe das folgende Szenario mit einem Ubuntu 12.04 und einem Ubuntu 14.04 getestet.
Unter 12.04 funktioniert alles einwandfrei - unter 14.04 leider nicht.


Die Frage vorneweg:
Wie bekomme ich das Ganze auf Ubuntu 14.04 zum laufen?





Folgendes Setup:

Ubuntu 14.04 LTS (Server Edition)

Habe installiert:

apache2-mpm-worker libapache2-mod-fastcgi php5-fpm (und die jeweiligen Dependencies...)



Ich habe danach folgende Module aktiviert:
a2enmod actions alias fastcgi cache cache_disk


Den fcgi-fpm wie folgt konfiguriert:

mkdir /var/www/cgi-bin
touch /var/www/cgi-bin/php5.fcgi
chown -R www-data:www-data /var/www/cgi-bin






Die Konfig /etc/apache2/mods-enabled/fastcgi.conf sieht so aus:

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
#FastCgiWrapper /usr/lib/apache2/suexec
FastCgiIpcDir /var/lib/apache2/fastcgi
Alias /php5.fcgi /var/www/cgi-bin/php5.fcgi
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5.fcgi
FastCGIExternalServer /var/www/cgi-bin/php5.fcgi -socket /var/run/php5-fpm.sock
<Directory "/var/www/cgi-bin">
Order allow,deny
<Files "php5.fcgi">
Order deny,allow
</Files>
</Directory>
</IfModule>








Am virtual host habe ich im Prinzip nichts geändert.

Die /etc/apache2/mods-available/disk_cache.conf sieht bei mir so aus:


<IfModule mod_cache_disk.c>

# cache cleaning is done by htcacheclean, which can be configured in
# /etc/default/apache2
#
# For further information, see the comments in that file,
# /usr/share/doc/apache2/README.Debian, and the htcacheclean(8)
# man page.

# This path must be the same as the one in /etc/default/apache2
CacheRoot /var/cache/apache2/mod_cache_disk

# This will also cache local documents. It usually makes more sense to
# put this into the configuration for just one virtual host.
CacheEnable disk /


# The result of CacheDirLevels * CacheDirLength must not be higher than
# 20. Moreover, pay attention on file system limits. Some file systems
# do not support more than a certain number of inodes and
# subdirectories (e.g. 32000 for ext3)
# CacheDirLevels 2
CacheDirLevels 5
# CacheDirLength 1
CacheDirLength 3

</IfModule>








Zum Testen habe ich dann ein php-File erstellt das den Timestamp ausgibt:

vi /var/www/test/cachetest.php



<?php
header("Cache-Control: must-revalidate, max-age=300");
header("Vary: Accept-Encoding");
echo time()."<br>";
?>This is printing the timestamp.






Wenn ich das File nun im Browser aufrufe zeigt es das aktuelle Time Stamp an.
Wenn ich das ganze jetzt auf Ubuntu 12.04 LTS teste und in die Browser Adresse klicke und ENTER drücke
so dass die Page neu lädt (funktioniert NICHT mit F5 - mit F5 wird
eine frische copy vom Server statt vom cache geholt) dann bleibt der Timestamp genau gleich!
Wenn ich das mit Ubuntu 14.04 LTS teste dann funktioniert es nicht.

Natürlich ist mir aufgefallen, das "mem_cache" welches in 12.04 noch zur Verfügung stand in 14.04 nicht mehr da ist.
Müsste aber doch trotzdem funktionieren, oder nicht?

Ich bin für jede Hilfe dankbar!
Euer halbsodoppelt
halbsodoppelt
 
Posts: 2
Joined: 07. May 2014 09:00
Operating System: Ubuntu 14.04

Re: mod_cache unter Apache 2.4 funktioniert nicht

Postby halbsodoppelt » 20. May 2014 13:26

Ist das Problem von irgendjemandem nachvollziehbar, oder hat irgend jemand ne Ahnung wie ich das Problem gelöst bekomme?
halbsodoppelt
 
Posts: 2
Joined: 07. May 2014 09:00
Operating System: Ubuntu 14.04


Return to Apache

Who is online

Users browsing this forum: No registered users and 140 guests