Developing Interactive, Scalable HTML5 Apps on the Cheap: Serverless, Unhosted, No Backend, BAAS, PAAS, Oh My
I’ve written before how HTML5 is the platform of the future for developing interactive educational apps, and you can even develop (code) in your browser (or chromebook) now. Well, the future is here, and HTML5 is still looking to be the best option, but there are some wrinkles. One is the slow pace of multimedia support in HTML5, in particular audio (a counterexample is 3D, in the form of WebGL, which is coming along faster than I expected). Two other things are actually good, but still challenging problems – 1) the explosion of HTML5 and Javascript frameworks: Meteor.js, AngularJS, Ember, Backbone, CanJS, Knockout, yadda yadda yadda (I’m particularly excited about Meteor, but none of these frameworks seem to have “ease of use” in their vocabulary, and accessibility is usually an afterthought, if considered at all – Dojo being one exception), and 2) the explosion of languages that compile to JavaScript: Coffeescript, Dart, TypeScript, yadda yadda yadda (Dart is one that interests me at the moment).
But one problem in particular has been my biggest hurdle, which I discuss more here: the cost of scalable hosting. With “old-fashioned” desktop apps or single-user applets or web animations or games, you can fire and forget it. Develop your app or site, slap it up on the web, and people download it or visit it and use it. Static web hosting is practically free (like this WordPress blog). However, if you want social features, persistence (database), or other things like that, you need to have a database or other backend at minimum, and it needs to be able to scale. I’ve always had my hopes up for Drupal - it is still my favorite go-to solution for social but non-interactive web applications, and several folks are using Drupal as a backend for HTML5 or mobile apps, but it is not so easy or so cheap to scale up. A lighter weight alternative to Drupal, perhaps built on node.js and MongoDB, has not yet emerged.
The Serverless, Unhosted, No Backend Options
Anyway, so, one hurdle to developing interactive educational HTML5 applications on the web is the cost of scalability. Web hosting is cheap (or even free) at the beginning, but can quickly spiral out of control and sometimes lock you into a proprietary platform (like google appengine). I could get a grant, but what about when the funding runs out? I could beg for money by posting my ugly mug at the top of every page like Jimmy Wales did on Wikipedia, but I’m not a sadist. I’m not a venture capitalist/entrepreneur, and unfortunately, I’m not at a university that supports or provides web application hosting (I used to be able to just run apps off the computer under my desk as an undergrad, grad, and professor, or by running cheap virtual private servers for as little as $15/year when scaling up wasn’t much of a concern).
Here are some sites that describe lower-cost, open source, and scalable cloud hosting solutions, by either letting visitors host their own data (in their browser’s local cache, or on dropbox or google drive or another site), or by using a cheaper backend-as-a-service that your front-end connects to. [Really, none of these (except WebP2P) are completely "serverless", and many do not eliminate the costs, either, but it is progress.] Various terms have been used for some of these concepts: serverless, no backend, unhosted, and there are also new and cheaper cloud hosting services that provide a backend-as-a-service (BAAS) or a platform-as-a-service (PAAS).
- No Backend – “a new approach to build data driven apps without thinking backend.” See the solutions and examples listed.
- Unhosted – “freedom from web 2.0′s monopoly platforms” – came before the “No Backend” movement and looks to be completely open source and not tied to one third-party platform. Their site also lists various tools and example apps that let users control their own data.
- Nimbusbase is an interesting option that uses Google Drive or Dropbox to store your user’s data.
- And here’s a sample PouchDB & CouchDB-based conference scheduling app that also works offline. (Just as some have stated a mantra that we should develop HTML5 applications “mobile first“, some have also stated that we should try to develop with “offline first” support, too, and to that I would also add “accessibility first“)
- WebP2P (peer-to-peer) is an effort that builds on top of WebRTC (real-time communication) to allow for truly serverless web apps – apps that connect from browser to browser. It is still very new, and only supported by bleeding edge versions of Chrome and Firefox (although there is a WebRTC datachannel polyfill to fill in some of the functionality for other browsers). See the WebP2P mailing list and WebRCT Google+ page for more info and examples.
- ShareIt, based on DirtyShare, is a proof of concept that allows you to share files from your browser
- PeerJS wraps the WebRTC implementation to provide a complete, configurable, and easy-to-use peer-to-peer data API.
- Open Peer is another WebRTC-based P2P Protocol & Specification
- GrimWire is a RESTful Browser OS that does Peer-to-peer over WebRTC. It is built on the Local framework, which allows you to securely run user applications on the page using Web Workers.
- KadOH (Kademlia Over HTTP) is a framework to build P2P applications for browsers and node.js. By implementing the basis of the Kademlia DHT used for decentralized peer-to-peer networks.
- hackview is a webRTC based multi-person video chat with a collaborative editor
- There are several other WebRCT based video chat apps and demos: appRTC is a basic demo, veckon is more polished, conversat.io adds a lunar lander game for you to play while waiting for others to join you, and the folks at Mozilla have a widget to embed video chat into your own website.
- There are various WebRCT SIP/VOIP gateways becoming available.
- The AirTheremin uses WebRTC and the Web Audio API to let you control sounds using gestures in front of your webcam
- Data URIs – New browsers support very long URLs, and you can actually store quite a bit of data in it, such as text or even an image.
- Shortly is a serverless pastebin service that uses this technique
- Jot is a note-taking app that also lets you encrypt your notes with a password through a client-side javascript encryption library
- The webSemantics Data to URI Converter will convert your image to a data URL
- DataURL will similarly convert files or images to data URLs for embedding in HTML or CSS files
- Back toward more server-centered strategies, the Backend-as-a-Service (BAAS) and Platform-as-a-Service (PAAS) Wikipedia pages list several cloud hosting providers, none of which really solve the cost issue, because you still have to pay for scaling up, but they can be cheaper on the whole than prior solutions.
- OpenShift by RedHat is an open source PAAS that I have found very interesting, and it appears to be very reasonably priced (and free for the entry level). You can host anything with it, node.js, Drupal, Java, etc.
- The BAAS market appears to be a very hot topic at the moment (see this BAAS ecosystem map), especially after one provider, Parse, was bought out by Facebook. But Apstrata is one that looks interesting, because you only pay by the number of users you have (under 500 is free), and it is made to work with Dojo Toolkit (and other options), which as I mentioned is accessible and also incredibly full-featured.
For an older article that hinted on this “serverless” trend, see Why The Future Of Software And Apps Is Serverless, and a newer article explores the No Backend movement in more detail: NoBackend: Front-End First Web Development.
Recent Course & Workshop Resources: HTML5, Drupal, Distance Education
Here are some web sites for courses I’m currently teaching or recently taught:
- Distance Education Tools - http://detools.wikispaces.com/
- This site now has dozens of links of various tools and technologies you can use with online and blended learning
- Multimedia Development with HTML5 - http://html5.wikispaces.com/
- As I posted earlier, HTML5 is emerging as an alternative to flash and java
- Instructional Design Projects – http://holton.usu.edu/moodle
- We learn how to use a learning management system (moodle) and about “post-modern” instructional design techniques, such as constructivism, problem-based learning, simulations, games, cases…
- Internet Development: http://internetdev.usu.edu/outline
- I’ll be teaching web development with the Drupal content management system again next summer. I hope to improve the videos.
At the AECT conference last week I gave a workshop on using Drupal to create web applications – here’s a Drupal Cheat Sheet I made for it. And here are slides for a talk on embodied cognition and instructional design.
Bash Script to Quickly Create Drupal Sub-sites
I haven’t tried this for real yet, only tested it with a local xampp-based drupal site, but here’s a shell script that quickly creates drupal sub-sites, say, for students. The sub-sites use the same database as your main drupal site, but each has its own table prefix.
So basically if you already have drupal installed, say at http://your.drupal.host/ , the script below makes it easy to create sub-sites like http://your.drupal.host/student1 and http://your.drupal.host/student2 . This uses drupal’s multi-site feature.
You just copy the below script to a file and make it executable (chmod 700 makesite.sh), edit some of the settings in it (like change “nobody” to “www-data” if using debian/ubuntu, and “localhost” to “your.drupal.host” or whatever),
and then on the command line change (cd) to your drupal root folder and run:
sudo /path/to/makesite.sh student1
Of course replacing ‘student1′ with whatever site name you want to use, and then you or your student/user can visit http://your.drupal.host/student1/install.php
to finish the drupal installation.
Of course, backup your main site’s database before using this (see the backup and migrate module).
For other related options see aegir, densite (both of which use separate databases per site), and domain (in which multi-sites not only share the same database but the same tables as well).
This script doesn’t handle sub-sites with their own domain names (see densite or aegir instead), and it doesn’t create cron jobs for each drupal site (see densite or just enable poormanscron on each site). Of course any modules or themes installed under sites/all/modules or sites/all/themes can be shared by all the sub-sites, so you only need to install them once. If you want a module or theme just for one particular subsite, install it under sites/your.drupal.host.student1/modules or sites/your.drupal.host.student1/themes or whatever the names are. Those sub-folders and the files folder are already created for you with the right permissions by the script.
I’ll also probably be using modules like theme_editor and zenophile so that students won’t need command line or ftp access to edit the look of their sites.
#makesite.sh ##About this script: ##This script will create a drupal sub-site using table prefixes. ##It assumes you already have a main drupal site running, ##and can be used to create sub-sites, such as: ## http://yoursite/subsite ##The database tables will have prefix: subsite__ ##The script also assumes that your main drupal site has ##no prefix ''. If that's not the case, edit the sed line below ##To run it: ## -First change the options below (apache user, site host) ## -cd into your root drupal folder (cd /var/www, etc) ## -run: sudo /path/to/makesite.sh subsitename ## 'subsitename' should have only have letters/numbers ## also it should not duplicate an existing sub-folder ## -then visit http://yoursite/subsitename/install.php ## to finish the drupal install ##### CHANGE THESE 2 or 3 TO MATCH YOUR CONFIG: ##### #what user does apache2/httpd run under: APACHEUSER="nobody" #www-data on debian/ubuntu #what is the root hostname/url of your main drupal site: SITEHOST="localhost" #root hostname for main drupal site #where to find the settings.php we'll base sub-sites on: DEFAULTFOLDER="default" #main sites/default/settings.php file #########Stuff below shouldn't need editing:######## if [ $# -ne 1 ] then echo "Usage: sudo $0 directoryname" exit 1 fi if [ $(whoami) != "root" ]; then echo "You need to run this script as root." echo "Use sudo $0 directoryname" exit 1 fi if [ -d $1 ] then echo "$1 already exists, please use a different name" exit 1 fi echo "Creating symlink from $1 to ." ln -s . $1 NEWSITEDIR="sites/$SITEHOST.$1" echo "Creating sub-site folders at $NEWSITEDIR" mkdir $NEWSITEDIR mkdir $NEWSITEDIR/files mkdir $NEWSITEDIR/themes mkdir $NEWSITEDIR/modules chown -R $APACHEUSER $NEWSITEDIR echo "Copying settings.php" OLDSETTINGS="sites/$DEFAULTFOLDER/settings.php"; if [ ! -f $OLDSETTINGS ] then echo "Cannot find default settings.php file: $OLDSETTINGS" exit 1 fi NEWSETTINGS="$NEWSITEDIR/settings.php" cp $OLDSETTINGS $NEWSETTINGS chown $APACHEUSER $NEWSETTINGS PREFIX="$1__" echo "Using table prefix: $PREFIX" #drupal 7: sed -i "s/'prefix' => '',/'prefix' => '$PREFIX',/" $NEWSETTINGS #drupal 6 ## sed -i "s/\$db_prefix = '';/\$db_prefix = '$PREFIX';/" $NEWSETTINGS echo "FINISHED: Visit http://$SITEHOST/$1/install.php to finish"
Syncing Two Drupal Sites
The drush module for Drupal has a new “sync” option to synchronize two Drupal sites, but it is undocumented and looking at the source code all it does is sync the files, not the mysql database. I haven’t seen any other public solutions that do completely sync 2 drupal sites including the databases.
Here’s a little shell script I’m using to synchronize the files and database of 2 drupal sites on different servers. We have a staging area where we test out upgrades or new code and features first. When not testing out stuff, we also use that 2nd server as a fallback in case the first server goes down. So this script copies everything over from the main drupal site to the 2nd staging area server using rsync, and then imports the mysql database on the 2nd server as well.
This script does depend on using the backup and migrate module for drupal, too, to dump the mysql database at regularly scheduled intervals to drupal’s files folder. The script fetches the newest sql dump and imports it into mysql on the staging area.
Also this script prompts for the ssh password to remotely connect. To run without any prompting, you’d need to generate an ssh key file (see this tutorial).
Edit the sections that start with ##EDIT:
##syncdrupal.sh
##EDIT:
STAGESERVERNAME="name.of.staging.server"
##run this script on staging area server only:
if [ `uname -n` != $STAGESERVERNAME ];
then
echo "only run this on staging area server"
exit 0
fi
##EDIT:
##src and dest can be remote or local (see rsync tutorials)
SRC="username@mainsite.edu:/path/to/mainsite/drupal/folder/*"
DEST="/path/to/stagingarea/drupal/folder/"
echo "Going to sync files from $SRC"
echo "to $DEST"
##I exclude cache because of a permission error with print/tcpdf/cache
rsync -e ssh -azv --delete --exclude="cache" $SRC $DEST
##EDIT:
SQLPATH="/path/to/stagingarea/sites/default/files/backup_migrate/scheduled"
##find most recent scheduled backup .sql.gz file:
MOSTRECENTSQL=`ls -1t $SQLPATH | awk 'NR==1{print $1}'`
gunzip "$SQLPATH/$MOSTRECENTSQL"
##get sql filename minus the ".gz" part
MOSTRECENTSQL=`ls -1t $SQLPATH | awk 'NR==1{print $1}'`
##EDIT:
##db name, user, pass for staging area mysql server:
DBNAME="db"
DBUSER="user"
DBPASS="pass"
echo "Importing $SQLPATH/$MOSTRECENTSQL"
##import the sql file into mysql:
mysql -u $DBUSER -p$DBPASS $DBNAME < "$SQLPATH/$MOSTRECENTSQL"
We also add a little code like this to our theme’s page.tpl.php file to flash a red box at the top of the staging area website so we’ll remember which site we are working on: (change “stage” to servername of your staging area, and change 5 to the number of characters in that name)
<?php if (strncmp($_SERVER['SERVER_NAME'],"stage",5) == 0) { ?>
<div id="warn" style="background-color:red;text-align:center;">
<h1>You are viewing a backup version of the WHATEVER website (servername).
Please do not save any information here.</h1>
</div>
<?php } ?>
Internet Development Course, Using Drupal
I’ll have a paper coming out this summer in MERLOT’s Journal of Online Learning and Teaching (JOLT) on using Drupal as a blended learning support tool for a class. This was my foundations of educational technology course in which students created their own wiki book called the Ed Tech Knowledge Base with notes about the field of educational technology. Later this summer I’ll be conducting a workshop at the MERLOT conference on using Drupal to build educational or academic websites, and also releasing the pre-configured Drupal site with the modules and views underlying our department website, called “Department 2.0″.
This summer I’m also teaching a course on Internet Development – beginning web development. All the materials and video screencasts are being posted online as well. I’m trying a new style of teaching web design. CSS is taught much earlier (in the 3rd week), tables much later. I’m using a more powerful text editor (JEdit) and Firefox addon (web developer) instead of the traditional notepad lessons. JEdit helps scaffold the process of authoring HTML and CSS files. Lastly, during the last month of class starting in late June we are going to learn about content management systems (in particular, Drupal). I’ve been building websites for 15 years starting with a site in 1995 for my student Amnesty International group that included a Perl CGI script to support letter writing, and in 1996 the Amnesty International USA site. But over the past 10 years pretty much every site I’ve built has used a content management system, starting with PHPNuke and later PostNuke, TikiWiki, and now Drupal. So I think it’s fitting to introduce students to content management systems even in a beginning class so that they are prepared to create real websites for some organization, business, or school.
I’ve put the materials for every course I’ve taught online, starting with a simple wiki outline for a survey class on computer applications such as iMovie, Dreamweaver, and Photoshop to my Advanced Learning Design course in Moodle (login as guest).
Related to all this, I’m helping a student finish up a dissertation exploring the motivations for why faculty at MIT put their courses online in opencourseware. Actually though, faculty have been putting their courses online on their own websites or using wikis like wetpaint or pbworks or wikispaces for many years. Below are some reasons for my own decision to put my course materials online:
- It sticks around for students and others to review later. In Blackboard and other traditional learning management systems your stuff disappears shortly after your class is over. I don’t really take to the philosophy that students should have to memorize everything for a test. They’ll forget it soon afterward anyway (see this five minutes university bit by Father Guido Sarducci).
- Re-use is easier. I can review a previous year’s class materials and revise them without having to start from scratch.
- Posting publicly online and using blogs I believe makes assignments more meaningful to the students and to myself. You aren’t just writing a paper for the instructor, but for everyone else to see as well.
- I can improve the materials on the fly, or post stuff before the whole class is finished. In traditional opencourseware, you don’t put your stuff out in the public until all the materials for the whole course are completely designed.
- It’s difficult to get people to observe your course for peer review and feedback. Even more difficult when you are teaching online. Members of my tenure committee and others can review my teaching materials much more easily when they are publicly accessible online.
- No one else is doing it in your area. There is no other open course out there on learning design or educational technology, and not even on internet development (except for some wikiversity notes). Of course there are thousands of HTML and CSS and Drupal tutorials and videos online, but this way I can organize them all or create new resources for one integrated course.
Btw, we are using a tweaked version of the creativecommons_lite Drupal module so that all wiki pages and blog posts on our site default to use a creative commons open license. But interestingly I’m already seeing students on their own pick other licenses for their blog posts. One student made a post public domain, another made it all right reserved, etc. Other faculty in my department are getting onboard as well, using Drupal as a blended learning support tool for their courses, and/or posting news and wiki pages to our site. We even used the wiki to work on a forthcoming article for Educational Technology magazine about our department, which is unique in that it combines both learning sciences folks and folks with a background in instructional design / instructional technology.
Setting up Apache, Secure SSL Drupal Logins, and Drupal multi-site support on Ubuntu
I updated my earlier instructions on setting up a secure Ubuntu server. I added notes about setting up fail2ban, which protects your server from repeated login attempts or brute force attacks.
In the course of setting up some new sites on a server, I realized there was a gap between those notes on initial setup of the server, and my other notes on configuring and getting started with drupal. So here here are some notes on configuring apache and drupal 6 with multi-site support and support for secure logins using the securepages module.
Instructions
This assumes you already have an ubuntu or debian server up and running
with apache2, mysql, and php installed as seen in these earlier instructions.
PHP5-GD Module and Mod-Rewrite
Install the php5-gd module (required by drupal, moodle, others for
resizing images and so forth):
sudo apt-get install php5-gd
Enable the apache2 mod-rewrite module (required for clean url support
in drupal):
sudo a2enmod rewrite
Edit the file /etc/apache2/sites-available/default, and in the “Directory /var/www/”
section, change:
AllowOverride None
to
AllowOverride all
Make this change also to the /etc/apache2/sites-available/default-ssl file when it is available. If you aren’t familiar with how to edit a file on the command line, use “sudo nano (filename)” to edit.
Enable Apache2 SSL support
This will increase the security of your website by encrypting communications for certain pages. Here are the instructions online for how to enable ssl support (scroll down to the “Enabling SSL” section). You can read your local copy of this README by running:
sudo gunzip /usr/share/doc/apache2.2-common/README.Debian.gz more /usr/share/doc/apache2.2-common/README.Debian
To enable SSL support, run these commands:
sudo a2ensite default-ssl sudo a2enmod ssl
Restart apache2:
sudo /etc/init.d/apache2 restart
Here’s another tutorial on this too if you want to sign your own certificate. These “self-signed” certificates will cause firefox to throw an error, and you’ll have to tell firefox to make an exception. For me that’s acceptable, but if it isn’t for you, you’ll have to purchase an ssl certificate.
Otherwise, to regenerate the default ssl certificate: (if apache2 gives you an error when you restart it or if your hostname changed)
sudo -s make-ssl-cert generate-default-snakeoil --force-overwrite exit
“sudo -s” switches you to the root user, and “exit” switches you back to your own user.
Set up PHPMyAdmin
sudo apt-get install phpmyadmin
(configure for apache-ssl if given a choice)
Add this line to /etc/apache2/sites-enabled/default-ssl:
Include /etc/phpmyadmin/apache.conf
Restart apache2: sudo /etc/init.d/apache2 restart
and visit the ssl version of your site to see phpmyadmin:
Remember you need to tell firefox to make an exception for your self-signed certificate. You’ll be able to login with username “root” and the mysql root password as soon as you specify it in the next step:
Create MySQL root password
First make sure you have a password for the mysql root user:
sudo dpkg-reconfigure mysql-server-5.0
Enter the password you want to use (twice), and make that password a good one. Write it down or save it somewhere safe.
Create database users for Drupal/Moodle/etc.
Login with “root” and that password in phpmyadmin using the https secure url: https://yoursite/phpmyadmin
Click on the link to “Privileges” and then the link to “Add a new user”.
Fill out the form. You might call the user “drupalsite1″ for example or
“moodledb”. Generate a strong password (write it down), and under “Database for user” check the radio button to “Create database with same name and grant all privileges”. Don’t check any global privileges.
Click the “Go” button at the bottom right and that will create a user
and database with the same name in one fell swoop. Remember the name
and password for when you install and configure drupal, moodle, or
whatever. Repeat these instructions (from “Add a new user” on) if you
plan on installing multiple php tools that use mysql. You’ll want a user for each drupal sub-site/sub-domain you are planning on running. A multi-site install lets you share the same drupal php files, but each site still needs its own database and settings.php file.
Download, install, and configure Drupal
See drupal.org for the latest version to download. If you want to avoid a lot of these “sudo” commands below, try a command like this (assuming you are in the admin group):
sudo chown -R root.admin /var/www
In the instructions below though, I use sudo. To download and install drupal:
mkdir ~/downloads cd ~/downloads wget http://ftp.drupal.org/files/projects/drupal-6.10.tar.gz tar xzvf drupal-6.10.tar.gz cd drupal-6.10 sudo cp -R * /var/www/ sudo cp .htaccess /var/www/ #remove old index.html file (replaced by index.php) sudo rm /var/www/index.html #create upload folder that server can write to: cd /var/www/sites/default sudo mkdir files sudo chown www-data.www-data files sudo cp default.settings.php settings.php sudo chown www-data.www-data settings.php
Now visit your site (http://yousite/) and run through the drupal installation. Enter the database name and password you created just for your default drupal site.
Drupal Multi-Site Configuration
This assumes you have created some other domain names (CNAMEs) for your server, or you want to install drupal at some sub-paths (http://yoursites/drupal2site).
See these instructions on drupal multi-site to guide you. I’ll assume the 2nd domain name is called “second.domain.edu” below:
cd /var/www/sites sudo mkdir second.domain.edu sudo cp default/default.settings.php second.domain.edu/settings.php cd second.domain.edu sudo mkdir files sudo chown www-data.www-data files sudo chown www-data.www-data settings.php
Visit http://second.domain.edu and install drupal again. This time using a different mysql user and database name. It is possible for multiple drupal sites to share one database though, by entering a different table prefix each time (see advanced options in drupal installer).
Setting up drush for easier Drupal management
Drush is a command line tool that makes it easier to install new modules and do other tasks. Right now the drupal 6 version is in flux, but it does work basically when I tested it.
Find the right tar.gz drush file to download. At the present, I have to download the cvs HEAD version for drupal 6:
cd /var/www/sites/all sudo mkdir modules cd modules sudo wget http://ftp.drupal.org/files/projects/drush-HEAD.tar.gz sudo tar xzvf drush-HEAD.tar.gz cd drush #see the README file sudo ln -s /var/www/sites/all/modules/drush/drush.php /usr/bin/drush
Now you can run “drush help” on the command line to test it. To actually install modules, you’ll want to prefix drush with “sudo ” unless you ran my earlier “sudo chown -R root.admin /var/www” command.
To install a module, change to the root directory of your drupal site [/var/www or /var/www/sites/(sitename)] run “drush dl (modulename)”. For example to install the pathauto module:
cd /var/www sudo drush dl pathauto
If you are in /var/www when you run the command, it will put the module in the sites/all/modules/ folder. That means all your sub-sites can use that module. If you want a module just for one sub-site, create a ‘modules’ folder under sites/(sitename) and cd into sites/(sitename) first before running drush.
See the drush page for more commands that work. In drupal 6, that’s the only command that works at the moment.
Have Drupal use SSL for logins
Run “sudo drush dl securepages”, and assuming that was successful, go to http://yoursite/admin/build/modules and enable the securepages module. Now change the url to https instead of http and visit the securepages configuration page to turn it on: https://yoursite/admin/build/securepages
Drupal module list
Here are some other modules I’ve been using. I haven’t checked them all for drupal 6 compatibility yet (ones marked with a ?).
securepages backup_migrate mollom poormanscron (if you can't run cron) print pathauto globalredirect path_redirect comment_notify ed_readmore fckeditor IMCE htmlcorrector webform date calendar advanced_help cck views contemplate panels? og og_mandatory_group wikitools? diff talk? freelinking interwiki? rules google_analytics
Ones I’m less certain I’ll be using in drupal 6:
image feedapi autologout autotimezone import_html invisimail jstools jq ldap_integration ldap_provisioning logintoboggan nodetype node_import user_import nice_menus prepopulate private similarterms site_map site_tour smtp tagadelic video_filter
See my Getting of the Ground with Drupal post for more info.
2 More Drupal Hacks
- Reservation system – Use cck_validation, date, calendar, & workflow_ng to create a system that allows for reserving rooms or other resources. The above link has php code for checking for time conflicts. Use the very latest 5.x dev releases of calendar & date.
- Group wikis – Modifications to the freelinking & wikitools modules so that [[Bracketed Links]] go to wiki pages in your own group, rather than showing all wiki pages by that name in all groups. Use the very latest version of organic groups (og).
Drupal patches
Here are a few minor additions contributed to drupal the past week to get our drupal site working the way we want. We are running it on an OS X server, which isn’t always the best idea, but we found that drupal’s ldap_integration module (and the php ldap extension) do not work with OS X’s LDAP (OpenDirectory) when you want to change your password. You have to run a special command (dscl) instead, so here is code to make drupal’s ldap work on an OS X server. It currently requires the drupal alt_login module, which we also needed to get LDAP working if you want people to be able to use real names as their drupal usernames. But the alt_login requirement is not necessary if you are not using real names in drupal.
The user_import drupal module is also very handy. You can take a spreadsheet of people and import them all at once into a drupal site. Here are two files that make it compatible with the ldap and alt_login modules as well.
Lastly, the organic groups module doesn’t have a way to filter views by a dropdown list of group names, you currently have to type in the group name by hand or the group ID number. So here is a code snippet that enables a dropdown list for easier filtering.
Using drupal as a first class wiki platform
Drupal doesn’t have a built-in wiki, but there are different options for incorporating a wiki with a drupal site.
One option is to use a separate wiki engine such as the popular mediawiki. There is an AuthDrupal extension for mediawiki that makes mediawiki use the drupal database for user account authentication.
Or you can create a wiki entirely within drupal itself. There are different options here as well, but some modules that you can use include:
- wikitools – you create a new content type (called ‘wiki page’ for example), and set wikitools to use it as the wiki type. Wikitools lets you set it so anyone you wish can edit the page, and it prevents duplicate pages from being created. Make sure you check ‘create new revision’ as the default option for that content type. You can also use the built-in book content type for wiki pages, if you want to enable hierarchically organized wiki pages for example as supported by the Atlassian Confluence wiki engine. See also these notes on making a drupal wiki with the book module.
- talk is a nice module that puts the comments on a separate talk page, just like with most wikis.
- freelinking lets people create [[bracket style]] links to other pages. If the page name doesn’t exist, freelinking displays links to search for or create the page.
- interwiki lets you create [single bracketed] links to other wikis or sites, such as for example: [map:Logan, UT] or [dictionary:someterm].
- video_filter lets people easily create embedded video links with syntax such as
- Other modules that add wiki-like touches include tableofcontents, recent_changes, and trash. Although in the case of recent_changes, I found the built-in “tracker” view was just as good at showing recent activity on the drupal site.
- If you want an input format that supports full mediawiki syntax, try for example pearwiki_filter, flexifilter (drupal 6 only), or the mediawiki module. I personally am fine with the WYSIWYG FCKEditor and IMCE modules instead, since special wiki syntaxes are difficult to master and can have the effect of alienating many users.
Other tips:
If you use pathauto and organic groups (og) you can have group-only wiki pages show up in a separate namespace. Also, recent versions of organic groups added a checkbox in the content types administration to set a content type as ‘wiki-like’, being editable by anyone in a group, which may mean wikitools is not even necessary if you only want wikis for groups.
Using drupal as a first class multi-user blogging platform
Drupal is one of the most powerful content management systems out there, but it’s built-in blogging support needs a bit sprucing up if you want it to more closely match the features of blogger or wordpress. Here are some modules that can help, see also these earlier notes on getting drupal installed and setup. I am not using all of these myself, just listing the ones I ran across for others’ information.
- I wrote in the earlier notes how to use the pathauto module to give blog posts nicer URLs.
- comment_info – if you are going to let anonymous folks comment (see more info below), install this so they don’t have to re-enter their contact info everytime. This is not required in drupal 6.
- The userlink module by funnymonkey.com can give users their own blogroll or del.icio.us style shared links to display on their blog (like you see on this one).
- comment_notify – let users be notified when someone responds to their comment
- tagadelic – in combination with the built-in taxonomy/categories module, show a visual tag cloud for your blogs
- relatedlinks – show related blog posts
- month – construct monthly archives lists and blocks, but you can also do this with CCK and views.
- blogtheme – lets users have a different visual theme for their blog than the rest of the drupal site.
Use a WYSIWYG editor such as FCKEditor and IMCE to let authors more easily create styled blog entries with embedded images.
If you want to allow anonymous folks to comment on your blogs, but are worried about spam or abuse, there are some tools that can help:
- mollom, created by the creator of drupal itself, passes on anonymous comments or forgotten password requests and so forth to their servers to scan for spam. If the servers are not sure, they pass back a visual captcha form for folks to fill out.
- abuse – lets people flag offensive or abusive content
- usercomment – let users moderate comments on their own blog
- wordfilter – If for example you want a profanity filter or something similar.
- filter_default – lets you change the default text input filter anonymous folks use
See the drupal multiuser-blogging group for more info and work being done to make drupal a more powerful blogging platform.


