Archive for April 1st, 2010

Fix to a problem with Varnish Cache not showing Apache’s .htm files extension on FreeBSD

Thursday, April 1st, 2010

I’m running my Apache server behind a Varnish Cache server. At most of the time all works okay, however today I’ve noticed a significant problem.
The problem consists in the fact that whenever I have directory listing enabled for some directory and I have dropped some .htm files, the htm files wouldn’t open as a proper html but instead the following message appears on click over some of the htm files:.

You have choosen to open 1.htm
which is a: PTHML file
from: http://myurl.com/
What should firefox do with this file?
(*) Open With (Browse ...)
( ) Save File ...

Here is also a screenshot of the error You have choosen to open … which is a: PHTML file:
you have choosen to open ... which is a PHTML file

At the beginning I though the error is caused by Apache and it was kind of weird since Apache my Apache serves a bunch of .html files without any issues.
It took me a while to realize that actually the problem is caused by the Varnish Cache server.
I digged my head into Varnish configuration, in hope to find something mentioned in the documentation but I couldn’t find anything meaningful there.
So after a while I decided to start experimenting with Apache.
Invoking the files directly on the port where I have Apache listening prooved me that Apache doesn’t have any problems with passing the .htm files content with a proper Application Type.
But anyways since I couldn’t find nothing in Varnish documentation, I’ve tried changing some stuff into my Apache configuration until finally I solved it!
The whole issue got solved by simply adding the following line in my Apache configuration file httpd.conf in my case on my FreeBSD

AddHandler application/x-httpd-php .htm .html .phtml

A simple Apache and Varnish restart and Hoooray, It Works again! 😀

Today is the Maundy Thursday

Thursday, April 1st, 2010

Today on Maundy Thursday(The Thursda of Mysteries) , we the Orthodox Chrsitians, celebrate one of the greatest Christian feasts.
It’s the day in which we commemorate the Passion, Death and Resurrection of our Lord and Saviour Jesus Christ.
Tomorrow this great day is followed by the “Good Friday” or the day in which we commemorate the crucifixion of the saviour and his death on the Calvary.
Today we at the Bulgarian Church as an Orthodox Christians honour the greatness of the Holy Eucharist that our Lord has bequethed us.
It’s a common practice in the Bulgarian Orthodox Church on that day that believing orthodox Christians receive the sacraments.
Let us be vigilant and honour the Son of God’s Holy Supper, Death and Resurrection in this day of grief and with spiritual sorrow remember and confess our sins, with deep realization for our unworthiness to be with the our Lord Jesus Christ.