Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Feb 05 2009
Feb 05

If that title doesn't get your attention, you aren't a geek, srsly.

drupal on the g1
After hearing a little interest from some people around irc-land, and from one person who I am considering starting a G1-fund for, I decided that I should try to get Drupal 7 working on my T-Mobile G1 phone. After all, it's an Open phone, right? I might have even uttered those words my wife and I always regret; "How hard can it be?"

Actually, it wasn't that hard :)

Many people have blazed trails in this direction, especially JesusFreke and Jay Saurik, by figuring out a new and better root hack for the G1 (and creating an image), and for creating a good way to get Debian on there once you have root.

Here is what I did:

First, I needed to get root access to my phone. For this I went to http://android-dls.com/wiki/index.php?title=Quick_Root and followed the directions. Pretty simple really. If you do have problems, a good place to ask questions is the Freenode IRC channel, #android-downloads, they were pretty darn helpful in there.

Second, I needed to install Debian. I tried, several times, to work through the fairly straightforward directions on Jay Saurik's post about getting Debian on the G1, however they didn't really take into account the new RC29 image by JesusFreke. Here is where I ran into the most problems, and they are all solved by going another route. After asking many seemingly dumb questions on irc.saurik.com #android, I was directed to an "installer" and was able to get Debian running smoothly using the instructions and files from here.

A couple of things to keep in mind when installing:

  • Some things seemed to have gotten corrupted, so check the hash.
  • Take your chances with this image, or download Jay's image, as I found tools that you might not want or need in this install, such as ettercap, tcpdump, aircrack-ng. Not sure what his game is, but it may not be good. You could always build your own image, as Jay mentions, and go from there.
  • With the newer images, insmod'ing ext2 and union isn't necessary, and in fact you will need to su, then modprobe ext2 instead.
  • I don't believe you have to use the version of BusyBox he mentions in the instructions, as JesusFreke includes a perfectly acceptable version in his image.
  • If you log out, you will need to su, and modprobe ext2 again before you can successfully run the bootdeb script again (actually I suppose this could just be added to that script).

One thing I want to mention, the "installer" guy uses passages and code directly from Jay's site, yet I don't see credit given there. I think saurik might say "Frowny Pants to that," maybe.

Third, if you make it through all of those hurdles, you can start installing stuff. I installed the following items, and modified some config files to get things to work:

  • apt-get install lighttpd php5-cgi php5-cli php5-sqlite
  • Edit /etc/php5/cgi/php.ini and include the line "cgi.fix_pathinfo = 1" at the end of the file
  • In that same file, up your timeout to something more reasonable for a phone ;) I put mine at 120 seconds
  • In the server.modules section of /etc/lighttpd/lighttpd.conf, you need to add "mod_fastcgi", including the quotes and the comma.
  • At the end of that same file add:

    fastcgi.server = ( ".php" => ((
                         "bin-path" => "/usr/bin/php5-cgi",
                         "socket" => "/tmp/php.socket"

  • Lastly, after making these changes, you should be able to run "/etc/init.d/lighttpd restart" and have a Drupal 7 ready web server running.

Fourth, install Drupal. To do this, go to your /var/www directory, wget http://ftp.drupal.org/files/projects/drupal-7.x-dev.tar.gz and unpack it. Rename it what you like.

A couple of notes, on the phone, you will need to cp /var/www/yoursite/sites/default/default.settings.php to /var/www/yoursite/sites/default/settings.php. You will need to mkdir /var/www/yoursite/sites/default/files. I am not sure, but I think I needed to also create the db file by doing a "touch /var/www/yoursite/sites/default/files/.ht.sqlite" and chmod'ing all of these so the server can write to them.

Run ifconfig on your phone to figure out what your IP address is, then point your browser (on a computer) to that IP/your site directory.

During the install, if you have things setup, Drupal will contend that it can install, and give you only the option to install using sqlite. It will ask you for the database name, and you will give it, exactly:


Do not give it a username or password for the database setup portion, it will not work (taken from http://drupal.org/files/issues/INSTALL.sqlite.txt)

I will guarantee that if you hadn't upped your PHP timeout in the previous step, you will now run into issues, however, if you had, you should be able to make it through the install, and CONGRATULATIONS! you now have Drupal on your G1!

See, how hard was that? :)

Edit: A note about Apache. I did try to do this with Apache2, however it seems there may be a bug with the Arm version of Apache2 binary that you get from apt-get install apache2, as it gave me the error "[emerg] (38)Function not implemented: Couldn't create accept lock /usr/include/linux" every time. I didn't decide to try to track this down. After getting lighttpd up and running it occurred to me that perhaps lighttpd was already installed and locking the socket, maybe? Don't know, someone else can track that down and figure it out. Lighttpd/php5-cgi/php-sqlite works for me.

Nov 25 2008
Nov 25

A tiny bit of history...

Four years ago, a very cool musician/web guy asked me to help him do some CSS work for another musician's site he was developing, on a platform called Drupal. I didn't know Drupal very well, but I had played with it, and knew CSS, so I said Sure! The site was cool, and I recall that I was editing all kinds of CSS files in all these different places (where I shouldn't have). It all seemed very complicated with these modules having their own style sheets. I was intrigued! But I was also confused by the taxonomy, and felt it was too complicated for the little sites I was doing at the time. After that project, I returned to doing things the way I had been doing them.

It is really too bad I didn't see the real beauty of Drupal at that time, that I didn't understand it's power, flexibility, and community. They were all there four years ago, but I didn't see them. If I had, who knows what I would be doing now? I might have been smitten by the drop, like that cool musician, Robert Douglass. That was his first Drupal site as well.

A short two years ago saw me doing freelance web design, implementation, and graphic design for any customer that would take me. I didn't know anybody in my industry, didn't have much of a network outside of it, and didn't like the prospects for the future. I was not doing well, at all. At that time I was creating sites on Joomla, and implementing stores using Zen Cart or OS-Commerce.

I was finally starting to get referrals from some of my Elance and Guru customers, but like those customers, the referrals didn't seem to care as much about quality, as they did price.

That was when I made a decision. It was simple, I wasn't making enough money to live on doing freelance design, and implementing simple carts and Joomla sites, I needed to get to the next level. I chose to get back into development. I started right away getting better acquainted with PHP, MySQL, and JavaScript. I found Code Igniter, and built my own CMS and blog (who hasn't?!?) and felt mighty!

Ha! I felt so mighty that I took on more than I could chew for an old customer. Humiliation taught me a couple of awesome business lessons, it can be good (sometimes GREAT) to say "no", and know how far beyond your limits you can really strive for. (Happy ending: he deciding that the site actually didn't make sense, wouldn't make money, and so we shifted his deposit to a more profitable venture, one that was possible, one that was based on Drupal. He is still my customer today.)

At that time, I was bouncing around some "open-source" projects and looking for something that fit me. I worked with Code Igniter, and really enjoyed it, they had a great documentation page, and good people. I also worked a bunch in Magento Commerce, which is a very nice application, but because of how it is offered, seemed not "open" enough for me. Very soon after finding Magento, I began working with Drupal again, and this time, it didn't just stick, it swallowed me. I finally "got it."

This last year has been a whirlwind. I haven't done everything right, and being an actual human being, I may have even possibly done some things wrong! I have flitted from one bright shiny Drupally thing to another, most likely annoyed many Drupal luminaries that I highly respect, and in my enthusiasm have stepped on toes or hurt people's feelings. But I have also found a community of people that have renewed my faith in people, made me see that people really can selflessly come together for a common goal, that even any one person, with redoubled effort, can make an enormous difference. That's a lot to say for a software project, but Drupal has been that impactful to me.

I came here, overly eager because I finally saw possibilities, I finally had found a project that people were fervent about, and very committed to. Drupallers LOVE Drupal, they don't just work on it. These geniuses transformed code into art while I watched, yet at the same time would again and again, very patiently, and with much decorum, entertain newbish questions that I know they had answered hundreds of times before.

I thought that it was probably the pink visor effect, that after a while, I would float back down from my pink Drupal cloud, and see that these were just the same as other people, that they couldn't possibly be that different, that good.

I was once again wrong, happily so. You, Drupal, bring out the better side of the people you attract. I am proud to be a part, even if it is a nearly non-existent part, of this project and community. Thank you.

And that brings me to today, and how just this much exposure to Drupal has changed me, and how I think, and how I am changing, and how I plan to do business differently (when by the way business is going bonkers, it seems counter-intuitive to change anything). It brings me to my goal, which has been many years germinating, and has now been given the water it needs to become fully realized.

I am finding it hard to continue to think small. I have a vision of creating more. My goal that I am dedicating myself to is creating my business differently, from the inside out. I aim to find terrific people who _care_ about people, and I am going to show them Drupal.

I mean to infect these people, to put them up on my pink cloud, and see if they smile. I mean to enrich them and this community at the same time. If I can find those people, and treat my customers and the Drupal community at large, to their good spirits, my goal will be half reached. My goal will be fully reached if I can in any way influence others to understand my belief; that caring, loving, pleasant people, make for much much better business.

I am very interested to see what will happen next, and intrigued by who I will meet on the way.

Sep 22 2008
Sep 22

I don't think much of Mollom on my Drupal site. It's not that I don't like it, actaully I freakin' LOVE it! It is just that I never, ever, have to think about it.

A couple of months ago I was told about Mollom by Josh Brauer and decided that I did indeed want to give it a try. It was supposed to be a site spam service, working as a Drupal module, to protect your site from being inundated with blog post spam, etc. It was supposed to be pretty much invisible, unless the Mollom service thought that the comment or post might be spam, then it would spring into action with Captcha check and nail the post as spam or ham as a result. It lives up to these expectations and more.

So, what makes Mollom different, from a end-user point of view, than the other spam solutions I have tried (Akismet, Spam Karma, etc.)? Nothing, or rather, you have to do nothing, which is a whole lot less than what you do with the others. In fact, you don't have to deal with queues, moderation, constant attention and emails about all of the above. In other words you don't have to do anything. Oh, yeah, and the fact that it just plain works. I have yet to see a spam on my site.

What's crazy is that until this morning, when I got an email letting me know that Mollom was out of beta and now you could buy a subscriptions for their bigger-site service, I had actually completely forgotten that I had it installed. I thought that it might not be on, but when I went into my Mollom admin, I saw to my surprise that it had blocked almost 100 spams from my tiny site in the last 30 or so days.

Oh yeah, and those stats that I was looking at, yeah, they are SHINY! Look at that nice graph, it fills my designy heart with happiness :)

Mollom Stats

I hope I didn't put you off with the words "Buy" and "Subscription", because Mollom is always free for sites with less than 100 comments/posts per day. They offer this because, in Dries' words "We make Mollom Free available for free because we think that making spam protection available to as many sites as possible is the right thing to do." Nice.

Mollom was contrived by Dries Buytaert who also brought us the awesomeness that is Drupal as well as the RedHat of the Drupal world, Acquia (I ask you, does he do anything that isn't awesome?).

Ok, now that I have put my thoughts down about Mollom, I can go back to forgetting about it. Some things are best when they aren't seen :)

Jul 26 2008
Jul 26

So this week I had to get search_files module for Drupal 6 running on a shared host, Bluehost, for one of my customers. I had promised that we would be able to search his PDF files, but I didn't realize that search_files, as well as search_attachments modules require a Linux command line utility named pdftotext to be installed.

I did request that Bluehost install it on my box and was told that anything requiring root access wasn't going to happen.

Fine, maybe I can run it myself, after all, I did get SVN running on Bluehost, how hard could it be?

Thanks to rasc on the Sphider PHP Search Engine forums for the solution, which I catered to work for search_files.

Setting up Bluehost

  • First, go to foolabs and grab yourself a hot copy of XPDF
  • Un-archive it, and get get rid of everything other than the pdftotext file
  • Rename this file to pdftotext.script
  • Create a shell script (flavor of your choosing) that calls this pdftotext.script file, for example:
/home/YOURBLUEHOSTUSERNAME/bin/pdftotext/pdftotext.script $1 -
  • As you can tell from the code there, you will need to change YOURBLUEHOSTUSERNAME to the correct name.
  • Log in via FTP or SSH, and create a /bin and a /bin/pdftotext directory from your home directory, NOT FROM public_html, but one directory above that
  • Make /bin/pdftotext writable by all, this is where pdftotext will save the temporary files it creates
  • Upload both pdftotext and pdftotext.script to the /bin/pdftotext directory, and make them executable (chmod 755 should work)
  • If you don't have one already, in your home directory (not public_html) create a .bashrc file, and add the following so that the web server knows where your executable files are:
export PATH=$PATH:$HOME/bin:$HOME/bin/pdftotext:.
export pdftotext_path=/home/YOURBLUEHOSTUSERNAME/bin/pdftotext/pdftotext

Setting up search_files in Drupal 6

  • Go to the search_files project page and download the module
  • Upload the module
  • Go to Admin - Site Building - Modules and activate the module
  • You may need to adjust your permissions to let you use the module, do that if needed
  • Go to /admin/settings/search_files/helpers page and click "PDF"
  • In the Helper Path* box, put in:
/home/YOURBLUEHOSTUSERNAME/bin/pdftotext/pdftotext %file% -
  • Click Update. Please notice the - at the end, it's needed. I have it in both the helper line and the script, it's probably not needed in both, but it DOES work this way
  • Now, find the Directories page (/admin/settings/search_files/directories) and start adding directories where you have those PDF files that you would like to have indexed, such as /home/YOURBLUEHOSTUSERNAME/public_html/files - making sure that you use the full server path

Run it!

I took advantage of this time as an opportunity to setup my cron job on Bluehost, and then cleared my cache in Drupal, ran cron, and watched it find hundreds of files for me.

You MAY need to create a new custom php.ini file for your Drupal installation (Bluehost has a utility to create a default one in c-panel) and increase the limits so that you don't run into memory allocation or timeout issues.

Hope this helps, if you have any questions, go ahead and leave a comment!

Jul 05 2008
Jul 05

This morning, before our morning walk, and other family affairs, I poked around making Drupal my personal wiki. Why, that's probably what your asking? Drupal is a CMS, or CMS framework, and there are alternatives to Drupal for sure when it comes to wikis. PHPWiki, DokuWiki, MediaWiki, even the hosted PBWiki all come to mind.

The answer is a little complicated. I was using Zim (desktop wiki for KDE) to basically do a brain dump and to plan out some things, and discovered that I really wanted to use that data on my other machine. Hmm, well, this is a wiki, says I to me, so I should just be able to find some other wiki software and drop it on my local PHP server and pop this stuff into it.

Nope, it's not that easy. What I ran into was that I had, at best, only a couple of the things that I wanted from a wiki in any given package. I guess those things were:

  • CamelCased markup ability to easilly create new pages and easy linking.
  • Easy Privacy. This wiki isn't for the world, it is for my brain-dumps and planning.
  • Hierarchy so that I could organize my content, split it between work and personal, and SEE that organization.
  • Ability to easilly change the appearance (or to just look good off the bat).
  • Ability to be used from any machine I was on (the only drawback to Zim).
  • Familiarity. I wanted something that didn't seem terribly foreign to me, so I wouldn't struggle using it.

Ok, so that's quite a few things. Maybe there are wikis that do all of these, and do them with ease, however the top picks on my Google searches didn't show me any that fit the bill. PBWiki doesn't do CamelCase, or if it does, I couldn't find it, and that's a show stopper for me. DokuWiki was supposed to be easy to setup, document based, no db, but the security page you are supposed to follow was horrid, and changing the look of the thing was impossible to figure out quickly. PHPWiki, I didn't even try after reading comments about it being a bear to install.

In the end, I decided to build it on my current Drupal 6 installation. I did a search on Google about drupal wiki, and though there were many resources, CWGordon's blog was the most helpful. It took me about an hour and a half, but in the end, I have what I expected, and I have it in a design I like :) Plus, I got to learn what it takes to create a Drupal wiki. It wasn't too hard, I used the following modules:

  • pathauto (so that I can have nice URLs :)
  • flexifilter (allows you to set a filter that is wiki style without coding it)
  • recent_changes
  • freelinking (this lets me do CamelCase links which searches first then creates if it doesn't exist, NICE)
  • tableofcontents (not really using this yet, because I am using Book Navigation in the sidebar)
  • token (dev to fix the [book-raw] and [bookpath-raw] issues I was having)
  • node_privacy_byrole (here is how I make the wiki private)
  • wikitools (for... well, guess)

You put it all together, enable permissions to use it all, always a gotcha, then tweak your settings (like your pathauto and enabling freelinking and flexifilter) then securing it if you want it private, or enabling write access for everyone if you want it public, and viola, a new wiki is born.

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web