Drupal StackScript for RH Derivatives on Linode (Instant Drupal!)

StackScripts are a relatively new offering from Linode that allow users to build their own installation script by "stacking" previously existing scripts together to build the machine you want. You can keep your StackScript to yourself, or publish it for the world to use. Deploying a distribution with a StackScript takes only about 5 minutes, afterwards you have a fully configured system with applications up and running. Here's a sneak-peek at a my Drupal StackScript for RH Derivatives deployment just before launch:

0
Your rating: None

Performing a CentOS Anaconda-based Install on a Linode for Kickstart, Root LVM and SELinux Features

Linode rocks. Seriously, read my review. I was talking to a co-worker (whom I converted to Linode as well) about how I would pay double the amount to keep my Linode now that I know how much I use it. Don't tell them that, they're cheap :) If you find this article helpful (or my article about moving VM's to and from Linode), please consider clicking one of the links in this article to sign up for a Linode - if you sign up for 90 days, I'll get $20 credited to my account.

I was setting up a second Linode that was to be a testing ground for some StackScripts I'm working on. The new Linode will eventually replace my existing one. For whatever reason, the most recent version of CentOS they had available was 5.3. Not a big deal, I can 'yum upgrade' up to 5.4 after installation. Well, after doing so, I found that a lot of features that I wanted had been stripped out. In Linode's defense, it's in their best interest to offer very stripped down images for their customers. The one feature I wanted that I couldn't get enabled was SELinux, and simply installing the packages still wouldn't let me use 'setenforce 1' to get it turned on. My best guess as to why is that the Linode kernel didn't support it, but I honestly didn't troubleshoot it too much. I really wanted root LVM capabilities as well, so I decided that a full-on anaconda based installation was the way to go. Plus, I couldn't find anything in the forums about it, so there was the lure of being the first to do it ;-)

Well, thanks to the flexibility offered by Linode, not only can you do a anaconda-based installation (with optional Kickstart), but you can do so using the GUI over VNC if you're so inclined!

5
Your rating: None Average: 5 (1 vote)

Sysadmin Humor

I laughed out loud when I saw this XKCD comic this morning:

0
Your rating: None

Assign Different Values to Different Nodes via One Action in Views Bulk Operations

The Views Bulk Operations module (a.k.a. VBO), is a godsend for busy Drupal site administrators. Don't just take my word for it - Lullabot wrote a chapter about it in O'Reilly's Using Drupal, it's included in the Open Atrium Drupal distribution, and it's even used on Drupal.org! Out of the box, VBO does a lot to streamline the things you do everyday, so that you spend less time doing them. A perfect example is bulk content moderation - with a few clicks of the mouse, you can mark a huge amount of comments as spam. You can even enable batch processing with a single click of a mouse so that you can literally do thousands of these without timing out.

VBO was attractive enough that we decided to offload the bulk/batch operations of Node Gallery to VBO. Integration for the most part was surprisingly easy - VBO "speaks" in Drupal Actions, so by writing actions, we were writing integration with VBO.

There's one undocumented case where VBO can be used that was critical for us. Most VBO actions you will find perform one action to a set of nodes, one at a time. Often times, that one action is to set a value of some sort on said nodes. In the case of Node Gallery, we wanted to be able to assign different weight values (used for sorting) to a bunch of nodes. The key here is that we aren't assigning a value of '2' to all selected node's weight, we want to assign a weight of 2 to node #1, 3 to node #2, 8 to node #3, and so on. While not straightforward, it's definitely achievable.

5
Your rating: None Average: 5 (1 vote)

HipHop PHP and Drupal

So, Facebook has released HipHop PHP - a PHP-to-C++ converter. While the name is stupid, the idea is not. 100% of their developers know PHP, I would guess that less than 5% of them are proficient at C++. So, HipHop takes their PHP code, and converts it to compiled C++ -- in turn, they get a huge boost in performance and get to keep their existing developers. HipHop is also it's own webserver too - fun!

My first thought was: I wonder what this could mean for Drupal? Well, David Struass, a maintainer of Pressflow (a set of patches for Drupal performance and scalability) put up a blog post about what it would take for Pressflow and Drupal to become HipHop-friendly. Exciting times!

3.666665
Your rating: None Average: 3.7 (3 votes)

Apache mod_proxy '[error] (13)Permission denied' error on RHEL

Had an interesting issue today working on a mod_proxy setup of Apache forwarding requests in a reverse proxy setup to a backend Tomcat server. No matter what I did, I kept getting this in Apache's error log:

[error] (13)Permission denied: proxy: AJP: attempt to connect to 10.x.x.x:7009 (virtualhost.virtualdomain.com) failed
0
Your rating: None

Teaching Java How to Commit Suicide

At $work, we have a lot of java processes that are ran via cron and other wrappers that do some pretty critical tasks. The apps have been written so that the whole thing is wrapped in a try/catch that will call system.exit(1) should something not go right. Our wrapper scripts watch for a non-zero exit code, and alert Nagios if something went wrong.

This works great except for when a VM encounters an outOfMemory exception (OOM). The Java VM attempts to continue on, but if the main thread hits this exception, the entire VM will exit. However, the application code that exits with a status of 1 never gets called, so the application ends up dying with a status of 0. Well, Sun (Oracle now I guess) gave us a new option in Java 6 that was backported to 1.4.2_12 and up that allows us to tell Java to run a shell command when it encounters an OOM exception. By adding the option

-XX:OnOutOfMemoryError="kill -9 %p"

to our Java command line, the VM will execute a shell that calls the kill command, with an argument of the PID of the VM. The -9 option to kill will cause the VM to exit with a non-zero status, so that our wrappers will pick up the error and alert the right people.

Note: this feature was never backported to Java5 - sorry!

0
Your rating: None

Display a CCK Filefield or Imagefield Upload Widget on Your Own Custom Form

Took a fair amount of googling around to find the solution to this one. With the Node Gallery 3.x branch, we needed a way to quickly add an image to an existing gallery. We could have displayed the whole node form, but there's a lot of things on that form that we can just use the defaults for 99% of the time. We need just three fields filled in: Title, Caption, and the imagefield itself.

4
Your rating: None Average: 4 (2 votes)

Drupal, meet Hudson; Hudson, Drupal...

At $work, we use Hudson extensively, and it rocks. For those who don't know already, Hudson is an implementation of Continuous Integration that is remarkably easy to use. I wrote about my first impressions of Hudson previously. Hudson's original audience was Java developers using Ant or Maven, but with plugins and some hacking, we can make it do some things for us as module contributors to Drupal.

3.333335
Your rating: None Average: 3.3 (3 votes)

ZFS in the Trenches presentation at LISA 09

Just got the chance to finally sit down and watch Ben Rockwood's presentation at LISA 09: ZFS in the Trenches. If you are even thinking about ZFS and how it works, it's a very informative presentation. There is very little marketing-speak, and he very specifically targets sysadmins as his audience. Great stuff! Of interesting note about his comparison of fsstat vs iostat, our Apache webservers routinely see about 5MB/sec reads being asked of ZFS, but the actual iostat on the disk shows that almost all of that traffic is being served up from ARC.

0
Your rating: None
Syndicate content