Skip navigation.
Home
Making the world a better place through software!

Drupal

lighttpd mod_rewrite with file exists check

lighttpd is a web server that is high performance and has a small memory footprint. On some of my servers I'm really low on both CPU and free memory. The web server I currently use, Apache, is quite large so I thought I test out lighttpd.

On top of the web server I run Drupal as my content manager and use Drupal's standard Apache conditional rewrite rules to make the two inter work well.

lighttpd can do rewrites but lacks the conditional test in its module, mod_rewrite.

There is a suggested solution which involves using an aternative module, mod_magnet, and using that to load in an interpreted programming language call "lua". But that seemed to have a high performance hit. So I modified a copy of mod_rewrite to support a new pair of options: url.rewrite-repeat-NF and url.rewrite-once-NF. These only apply the rewrite if the file corresponding to the URI does NOT exist in the Filestore (NF = Not Filestore).

UPDATED: 1 Feb. Bug reported by Frieder Schüler with -NF rewrites being ignored. Found and fixed. Please download the new copy.
You can find a copy of the code here: mod_rewrite.c

Here it is compiled under Debian on Intel to run in /usr/local/lib:
mod_rewrite.so and mod_rewrite.la

LM_PayPal Module for Drupal

This module provides an interface to PayPal using Instant Payment Notifications (IPN). It is designed to work with Drupal 4.7 (and Drupal 5.0.0 dev) and supports paid memberships (subscriptions), donations (tip jar) and paid adverts (classified ads). As this is now a Drupal project please use this webpage to find out about it: http://drupal.org/project/lm_paypal

Drupal/TinyMCE vs Firefox weirdness

To have WYSIWYG editing in Drupal you have to install either FCKEditor or TinyMCE (htmlarea is, apparantly, no longer supported). Since I've used FCKEditor in the past I started with that. But it seems incredibly slow!

So I tried out TinyMCE insead but found that NONE of the pop-up based features worked under Firefox. They worked fine under Internet Explorer!

I tried disabling all the pop-up blockers under Firefox... no joy 

Creating a basic website with Drupal, MySQL, Apache and Bind

These are my notes on the steps you need to take to create a basic website based on Drupal (4.6).

It presumes you already have a domain name registrar (I use www.godaddy.com), somewhere to host the website that already has Apache, MySQL, PHP and Drupal installed (I have my own Virtual Private Server on spry.com) and access to a name server (I run Apache).

First is to register the domain name (I'll be using example.com in this example!)

Then give your name server the details of this new domain. In my case I use bind (9) as my nameserver so I update named.conf to add:

zone "example.com" {
     type master;
     file "example.com";
};

Then create the file with the domain details in it:

 $ORIGIN  example.com.
$TTL     86400
          IN        SOA      ns.example.com. root.example.com. (
         2006011001      ; Serial
         10800           ; Refresh
         3600            ; Retry
         604800          ; Expire
         86400     )     ; Minimum
         IN        NS      ns.example.com.
         IN        NS      ns2.example.com.
         IN        MX 10  mail.example.com.
         IN        MX 20  mail2.example.com.
         IN        A       1.2.3.4
www       IN        A       1.2.3.4
mail      IN        A       1.2.3.4

A coupl of hints. For the value for the serial field I the date as YYYYMMDD + VV, the version on that day. Also the third last line give the domain name an address. This means users could type "http://example.com" as a valid website address. Of course this would require extra settings in both the nameserver and webserver. This will be covered in a future article.

Drupal Taxonomy

Here at LMMRtech we are fairly new to Drupal, the CMS. In the past we have worked with Typo3, Mambo/Joomla, and even a small CMS we developed in-house. Drupal is very different. It puts content first and foremost.

This approach is one of the great strengths of Drupal. It is also, perhaps, its most confusing feature.

For example. Think of a simple "brochure" website.  A few static pages, perhaps arranged in a heirarchy. Although this can be done in Drupal it is nowhere near as easy as it would be in other sites. Because most CMS packages think in terms of pages  and folders. A simple site is just the default folder and some pages in it. Great for a tiny little site. But quickly the limitations show when sites get large. Folder help a lot but they fail too because it is hard to have one page in several folders.

Syndicate content