Grepping for Terms on Separate Lines but Near Each Other

I wanted a way to search through the ~200 themes we have on WordPress.com to find out which ones registered sidebar areas for the home page, and this is what I came up with: find . -print0 |xargs -0 grep 'register_sidebar' -s -A 2 |grep 'home\|front' |more That’d have to be customized to fit other […]

Continue reading...

Connecting to a PPTP VPN from an OpenVZ CentOS VPS

When setting up the PPTP and PPP packages on an OpenVZ VPS in order to connect to a VPN, there are a few extra steps you need to take that you don’t have to do with a non-virtualized box. First, you have to load the following kernel modules on the hardware node and/or set them […]

Continue reading...

Cronie Depends on Sendmail in CentOS 6

I ran into a problem the other day when building a new CentOS 6 VPS template. After doing some of the initial work I ran yum update, and it worked fine. Later on, after installing the AtomiCorp repo, I tried to run it again and it failed with errors about Qmail obsoleting Sendmail, not being […]

Continue reading...

FastCGI errors after PHP upgrade

I ran into a small problem upgrading PHP from 5.3.5 to 5.3.10 on a MediaTemple CentOS VPS today. The upgrade completed without any errors, but when I reloaded the site I got a “500 Internal Server Error” message. It was the stock installation, so I’m not sure which module it was using or what repository […]

Continue reading...

Directory Permissions for WordPress under Plesk/Linux

Jason Diehl describes the right way to setup directory permissions on a Linux box running Plesk so that WordPress can automatically create the directories it uses to store uploads. Basically, you need to make sure that PHP’s safe mode is turned off and that wp-content is owned by apache, in the apache group, and chmod’d to 777.

Installing Additional Software on Endian Firewall

Endian doesn’t ship with gcc, apt or yum, so it can be kind of confusing at first if you’re trying to figure out how to install some extra packages. It comes with Smart Package Manager, which you can use to install CentOS binary RPMs from http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/ (CentOS 4) or http://mirror.centos.org/centos/5/os/i386/CentOS/ (CentOS 5). Try the version 4 first. […]

Continue reading...

Updating OpenDNS With a Dynamic IP From an Endian Firewall

The Endian router/firewall appliance comes with a Dynamic DNS client that supports the major DDNS providers, but it doesn’t support updating OpenDNS, which is necessary for any custom settings on your OpenDNS account to be applied to the traffic you pass through their servers. It’s possible to configure this yourself, though. There’s a helpful post […]

Continue reading...

PHP Error Logs with Virtuozzo

Virtuozzo sets domains up to have PHP’s display_errors flag turned off by default, so that you’ll only see a blank page when there are critical errors. This is a good thing in production environments because it avoids potential security issues, but it can also be annoying when you’re trying to debug something. Instead of displaying […]

Continue reading...

Firewalling an OpenVZ node and containers

The OpenVZ wiki has a nice script for firewalling an OpenVZ node and it’s containers. It creates a service and configures iptables to block all traffic to the node (except the ports you specify), but allow all traffic through to the containers, so that they can manage their own firewall. It also allows the container’s […]

Continue reading...

Relaying Qmail Through a Spam Filter

If you’re running a mail service on a web server so it can send out e-mail from contact forms, etc then you’ll want to make sure it’s relaying outbound mail through a spam filter, or it could be used to send spam if the forms get hijacked. For qmail, you just need to create /var/qmail/control/smtproutes […]

Continue reading...