Configuring Lighttpd for WordPress with Rewrites

Today I had to configure a WordPress website to use Lighttpd. I looked for the proper rewrites to use and only received garbled information about the rewrites. So instead of forgetting it again for the umpteenth time, I will post my getting WordPress to work with Lighttpd tips / tricks here.

First up there are three key rewrites to get Lighttpd to work with WordPress. They are as follows: (note mod_rewrite will need to be enabled and this is in the lighttpd.conf).

url.rewrite = (
        "^/(wp-admin|wp-includes|wp-content)/(.*)" => "$0",
  "^/(.*).(.+)$" => "$0",
  "^/(.+)/?$" => "/index.php/$1"

The second key item is making sure that the error handler is set properly.… Read More

Tricks to a Simple and Secure Contact Form using PHP

A day does not go by it seems that someone is asking how to create a simple contact form in PHP. The problem I tend to find is that most of the tutorials online show bad programming practice, such as using the @ error suppressor or not validating / checking the data passed into the form. I decided to write up a few of my tricks on how to do a proper PHP Secure Contact form and attempt to explain why. As always, I welcome comments / suggestions in the remarks. I have decided to omit the Captcha, as I feel Captcha is just broken, so if you want to prevent spam, you will need to research other methods, like Honey Pots.… Read More

Hacking NGINX and PHP-FPM Running Debian

A guy trying to get NGINX / PHP-FPM working

Keeping logs is a part of system administration. For me, I keep my logs of items I have installed in my articles. This way I always have the instructions to reference when I need to look back and do other installs. Today I am writing about how to setup NGINX that uses PHP-FPM on Debian. This can be a faster alternative to FastCGI in that you set the number of instances it will always run and the max that PHP-FPM is allowed to run. PHP-FPM allows for more control making a PHP server lighter weight when the extra weight is not necessary.… Read More

Redmine on Debian 6 with Unicorn and NGINX

A unicorn with it's refelction in water.Redmine is perhaps my favorite Bug tracking, ticketing, wiki, forum, documentation software there is. My only complaint in the past about Redmine was the fact that you needed to use Passanger to run it (which is a RAM hog). Having a bunch of low end VPS’s (Virtual Private Servers) I decided to attempt hacking Redmine onto a 128MB Ram box. Well after doing my research I came upon a neat little trick, Unicorn. Unicorn is a webserver that we can use in place of Passanger to serve Redmine to NGINX, our main webserver. Time to gallop to the setup.… Read More