Dateien in Varnish invalidieren

Um in Varnish eine bestimmte Datei zu invalidieren, die bspw. unter mehreren URLs geliefert wird, kann man diese mittels „ban“-Befehl invalidieren.

Beispiel:
varnishadm ban req.url '~' 'DATEINAME\\.zip$'

mySQL Aggregat-Funktion „PRODUCT()“

Um einen „Boost“-Faktor über mehrere Zeilen hinweg berechnen zu können, wird eine Aggregat-Funktion „PRODUCT()“ benötigt, die es in mySQL nicht gibt.

Mögliche SQL-Abfrage:
SELECT SUM(field) FROM table WHERE condition = true GROUP BY something;

Gewünschte SQL-Abfrage:
SELECT PRODUCT(field) FROM table WHERE condition = true GROUP BY something;

Lösung:
SELECT EXP(SUM(LOG(field))) FROM table WHERE condition = true GROUP BY something;

Die Lösung habe ich hier gefunden, wo sie auch nochmal genauer erklärt wird.

Row Data Multiplication in Oracle

Change Solr password with cURL

To enable Solr password authentication create the following file:
/var/solr/data/security.json
(The path may be different on your system!)

{"authentication":{"blockUnknown":true,"class":"solr.BasicAuthPlugin","credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},"":{"v":0}}}

Next run this cURL command:
Replace the „XXX“ by your new password.

curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -X POST -d '{"set-user": {"solr" : "XXXXXXXX"}}'

Install Varnish with XKey on CentOS 7.x

#Install requirements
yum install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz

#Download Varnish and install package
wget http://repo.varnish-cache.org/redhat/varnish-4.1/el7/x86_64/varnish/varnish-4.1.6-1.el7.x86_64.rpm
rpm -i varnish-4.1.6-1.el7.x86_64.rpm

#Download level-pack and install
wget http://repo.varnish-cache.org/redhat/varnish-4.1/el7/x86_64/varnish/varnish-devel-4.1.6-1.el7.x86_64.rpm
rpm -i varnish-devel-4.1.6-1.el7.x86_64.rpm

#Download modules and compile
wget https://github.com/varnish/varnish-modules/archive/master.zip
unzip master.zip
cd varnish-modules-master
./bootstrap
./configure
make
make check
make install

Plesk adjust customer


#Remove unwanted files
find . -name .svn -exec rm -rf '{}' \;
find . -name .svn -exec ls '{}' \;

#Change owner / group
chown -R USERNAME httpdocs
chgrp -R psacln httpdocs/*
chgrp psaserv httpdocs

#Change rights
chmod -R -s ./httpdocs/*
find ./httpdocs/ -type f -exec chmod 0644 {} \;
find ./httpdocs/ -type d -exec chmod 0755 {} \;