Monthly Archives: December 2011

Dec 30

  • Created: Dec 30, 2011 10:20 AM

Installing Apache Solr on CentOS

Installing Apache Solr on CentOS
Apache’s Solr search platform is a common solution for more flexible and better performing searches on sites that have outgrown their database’s built-in search facilities. Here at Nexcess, the most common use is by clients with Magento Enterprise Edition (the only version with built-in support for Solr). In this post I will walk through setting up Solr for general use, with some comments on setting it up for use the Magento EE.

Solr runs as a Java servlet, so the first thing needed is a way to run Java servlets. We’ll be using the OpenJDK and Tomcat from the JPackage repo, so we need to install the repo with:

wget http://jpackage.org/jpackage50.repo -O /etc/yum.repos.d/jpackage50.repo

Then install tomcat and java:

yum install -y java-1.6.0-openjdk tomcat6

Read more

Posted in: Apache
Dec 19

  • Created: Dec 19, 2011 11:03 AM

Debugging Apache Rewrites and Redirects

Debugging Apache Rewrites and Redirects
Apache’s mod_rewrite and mod_alias can be very useful, but they can also be a huge pain to debug when a problem arises. Luckily, there are a few things that can help, and since you’re probably not the first person attempting to rewrite or redirect something in a specific way, you’ll likely be able to find the answer by just searching around intelligently once you understand the basics.

The first resource that I use would be the Apache mod_rewrite and mod_alias documentation. It might seem tedious, but Apache HTTP Server actually has some of the best documentation in the industry. If you spend 10 minutes reading the actual documentation and give understanding it a shot, you’ll probably find the majority of your questions answered. Make sure you check out the section of the mod_rewrite docs that covers the RewriteLog directive, since having a log turns guesswork into something debuggable.
Read more

Posted in: Apache
Dec 5

  • Created: Dec 5, 2011 9:45 AM

Features of Grep

Features of grep

In my last blog posting I wrote about features of the less pager. Its one of those very common Linux utilities that everyone uses but no one reads the man page to learn about features. Just like less, everyone uses grep, but there’s a lot of features you’re missing out on if you haven’t read the man page.

grep is a very very old command, its name comes from the command that was run through the ed editor. If you wanted to print out the lines of a file that matched a regular expression (re) you’d run ‘g/re/p’ in ed which stood for globally search for a regular expression and print the matching lines. vi and sed users might recognize the syntax and other basic ed commands since they both adopted a lot from ed.

Read more

Posted in: Linux