Varnish 3 – Exclude a virtual host

1

If you have multiple virtual hosts on your webserver, installing Varnish will cause all virtual hosts to be cached. With VCL it’s possible to exclude some virtual hosts.

sudo nano /etc/varnish/default.vcl
sub vcl_recv {     # Don't cache domain1.com or domain2.org - optional www     if (req.http.host ~ "(www\.)?(domain1.com|domain2.org)\.(com|nl|org|dev|local)") {         return (pass);     } } sub vcl_deliver {     # You can optionally set a reponse header so it's easier for you to debug

More >

Ubuntu 12.04 – Install Varnish 3 in front of Apache 2

5

Step 1: Install latest version of Varnish (3.0)

These first three lines are probably not required on Ubuntu 12.04 because the main repository already contains version 3, but you can use it anyhow. Older version of Ubuntu do need it though!

curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install varnish

Step 2: Set backend server (Apache)

Edit the varnish configuration file.

sudo nano /etc/varnish/default.vcl

Set the backend server. The lines below say that the backend server (Apache) is available More >

Test in IE6/7/8/9 on Ubuntu 12.04 with VirtualBox image

0

It’s always a bit difficult to test your webapplications in Internet Explorer if you are developing on Ubuntu. Your default test browser there will most likely be firefox. But with with VirtualBox and Microsoft’s “Internet Explorer Application Compatibility VPC Image” it’s possible to test your website in a native IE6, IE7, IE8, IE9 and so on. Even on different platforms like Windows XP, Windows Vista or Windows 7!

It’s a bit hard to set it up, but let me show you how!

UPDATE: Testing IE with VirtualBox on linux has become easier with the xdissent ievms project! More >

Command “df” in linux shows incorrect free space after file removal

0

Today the “/tmp” directory was full on a server because of a huge log file. When I checked it with the command “df -h” is saw that the directory used 100% of disk space. After I removed the log file, “df -h” still displayed the same value. I thought that it might be a caching problem, but the fact is that deleting a file name doesn’t actually delete the file. It is not visible anymore if you execute the command “ls -sal”, but if some other process is holding the file open, it is not really deleted.

To see which More >

Solr 3.5 – Search case insensitive on a string field for exact match

6

Solr has by default in the schema.xml the field type “string” available.

<!-- The StrField type is not analyzed, but indexed/stored verbatim. --> <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

With this field type you can search with a string to get an exact match, instead of a contains match that the “text_general” field type will give you. However another difference is that the “text_general” field type is case insensitive by default and “string” is case sensitive.

To perform an case insensitive exact match search, you’ll have to add a custom field type More >

Solr 3.5 – Stop words are not removed

3

At http://wiki.apache.org/solr/LanguageAnalysis stop word files can be downloaded for several languages. Also the one for the English language is more extended than the default one shipped with Solr.

However if you enable them with the solr.StopFilterFactory the stop words still are not removed. This is caused by the “|” pipe characters after each word. Solr wants every word on a new line without anything else. Also replacement of | to # doesn’t work. This problem can be hard to discover if you expect that information provided by the Solr website should just work.

So to still contain the More >

Solr 3.5 – Multiple stop word files

1

As of Solr version 1.3 it’s possible to use multiple stop word files. You can define multiple files comma seperated like this:

<filter class="solr.StopFilterFactory" ignoreCase="true"    words="stopwords_en.txt,stopwords_nl.txt"    enablePositionIncrements="true" />
Go to Top