Pieter Vogelaar

Pieter Vogelaar

(23 comments, 60 posts)

Hi, my name is Pieter Vogelaar. I’m a web developer / DevOps engineer / IT consultant and specialized in high traffic and high profile websites. I love open source and have a great passion for automating and developing things!

Home page: http://pietervogelaar.nl

Posts by Pieter Vogelaar
solr-4

Ubuntu 12.04 – Install Solr 4 with Jetty 9

8

This tutorial requires that Jetty is installed as described at http://pietervogelaar.nl/ubuntu-12-04-install-jetty-9.

In this tutorial we use an example project named “airport” and a core named “flight”.

cd /opt
wget http://apache.hippo.nl/lucene/solr/4.0.0/apache-solr-4.0.0.tgz
tar -xvf apache-solr-4.0.0.tgz
cp apache-solr-4.0.0/dist/apache-solr-4.0.0.war /opt/jetty/webapps/solr.war
cp -R apache-solr-4.0.0/example/solr /opt

Optionally you can copy the “dist” and “contrib” folder as while if you want to use the data import handler for example:

cp -r /opt/apache-solr-4.0.0/dist /opt/solr
cp -r /opt/apache-solr-4.0.0/contrib /opt/solr

Add to the bottom of /etc/default/jetty this line:

JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr $JAVA_OPTIONS"

Add a Solr core, as example copy the More >

jetty-featured-proportions

Ubuntu 12.04 – Install Jetty 9

41

This article will show you how to install Jetty 9 on Ubuntu 12.04. Perform all steps as root.

Jetty requires Java. Install Java first, I prefer openjdk instead of oracle jdk, but it should work both.

apt-get install openjdk-7-jdk

Create a symlink for easier reference from jetty

mkdir /usr/java
ln -s /usr/lib/jvm/java-7-openjdk-amd64 /usr/java/default

Go to the opt directory

cd /opt

Download the latest Jetty distribution (9.x).

wget "http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.0.M3.tar.gz&r=1"
mv download.php\?file\=%2Fjetty%2Fstable-9%2Fdist%2Fjetty-distribution-9.0.0.M3.tar.gz\&r\=1  jetty-distribution-9.0.0.M3.tar.gz

Unpack the archive

tar -xvf jetty-distribution-9.0.0.M3.tar.gz
mv jetty-distribution-9.0.0.M3 jetty

Create jetty user and make it More >

Nginx

Ubuntu 12.04 + Nginx 1.2.6 + PHP-FPM server block / vhost example

0

On the internet there is not a clean and good example that is basic and follows the best practices. Below I created a working server block / vhost or virtual host example that works on Ubuntu 12.04 and Nginx 1.2.6..

Read the page Nginx basic configuration carefully to understand how location directives work, it really explains it well! Especially this part is important:

Directives are processed in the following manner:

  • Exact string matches are processed first. If a match is found, nginx stops searching and fulfills the request.
  • Remaining literal string directives are processed next. If

More >

Ubuntu 12.04 – Install OpenPanel

11

The OpenPanel team doesn’t support Ubuntu 12.04 server officially yet, but I got it installed with a few alternate steps and it seems to work fine. I have it running in a production environment.

The original installation steps for older Ubuntu versions are described at http://www.openpanel.com/download/openpanel-download/. But for Ubuntu 12.04 just follow the steps below and it will work. Make sure you execute all steps as root.

nano /etc/apt/sources.list

Add the following lines at the very bottom of /etc/apt/sources.list, save it and go back to the terminal with Ctrl + X and than Y for the More >

Solr 3.5 – Wildcard search as SQL LIKE

1

The Solr schema.xml has by default the “string” fieldType.

<fieldType name="string" class="solr.StrField" sortMissingLast="true" />

Add the following fieldType to your schema.xml and use it as field type for your field:

<fieldType name="string_rev" class="solr.TextField" sortMissingLast="true">     <analyzer type="index">         <tokenizer class="solr.KeywordTokenizerFactory"/>         <filter class="solr.LowerCaseFilterFactory" />         <filter class="solr.PatternReplaceFilterFactory" pattern="(\s+)" replacement="" replace="all" />         <filter class="solr.ReversedWildcardFilterFactory" />  

More >

Git delete local and remote branch

1

First checkout a different branch than the one you want to delete, for example the master branch.

git checkout origin master

Solution 1

To delete your local and remote branch execute the following. “-r” stands for remote and “-d” for delete.

git branch -rd example

Solution 2

First delete the local branch:

git branch -d example

And after that also the remote branch:

git push origin :example

Varnish 3 – Block ip addresses

3

To block ip addresses with Varnish edit the following file:

sudo nano /etc/varnish/default.vcl

And add the following. Of course replace the example ip addresses with the real ips you want to block.

acl forbidden {     "111.11.111.111";     "123.12.123.123";     "456.123.12.72"; } sub vcl_recv {     # Block access from these ips     if (client.ip ~ forbidden) {         error 403 "Forbidden";     } }

After editing, execute:

sudo service varnish restart
Pieter Vogelaar's RSS Feed
Go to Top