Writing Drupal modules 101 -- course for newbies

, posted: 25-May-2007 13:04

STEP ONE! Install drupal somewhere.
Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Tens of thousands of people and organizations have used Drupal to power scores of different web sites,
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License. suitable for cms/drupal newbies Prereq: php knowledge, basic SQL knowledge.

1. Download official release tar ball from http://drupal.org and untar on your workstation.

http://drupal.org You want Drupal 5.1.

2. Configure a simple apache virtual host, and use this directory as DocumentRoot. (you'll also need mod_php, and php- installed)

Example Virtual host for drupal

  DocumentRoot /home/brenda/projects/drupalfive/
  ServerName  gargi.wgtn.cat-it.co.nz
  DirectoryIndex index.php
  ErrorLog /var/log/apache/drupalfive-error.log
  TransferLog /var/log/apache/drupalfive-access.log
  CustomLog /var/log/apache/drupalfive-referer.log referer
  php_value error_log /var/log/apache/drupalfive-error.log

  
  # Rewrite current-style URLs of the form 'index.php?q=x'.
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  

Note the Mod rewrite rules. These are also in .htaccess files, so optionally you can turn on .htaccess processing in your apache config. The mod rewrite rules turn on "clean urls" (we'll get to them later).

3. create a database (mysql or postgresql)

Mysql is well supported by Drupal. Postgresql was added, i think, in 4.6, (the same release dropped support for MS SQL server) and pgsql is also currently well supported by everything in the core tar ball. However, postgresql is far less common, and support will only continue as long as dedicated volunteers are contributing to drupal. If you find a postgresql specific bug - please investigate and file bug reports and/or patches. To make Postgresql trust authentication work - You will need to apply this patches http://drupal.org/node/125105 install.pgsql_.inc_.patch (730 bytes) To make content sort properly: http://drupal.org/node/128846 20070330-drupal-database.patch To apply:
cd drupal-5.1/includes
patch -p0 < install.pgsql_.inc_.patch

4. edit sites/default/settings.php, providing database details.

Have a look in your sites folder. Under there you'll find something like this: drwxr-sr-x 2 redirects redirects 4096 2007-01-30 13:20 all drwxr-sr-x 2 redirects redirects 4096 2007-05-01 11:30 default default contains the default configuration for this drupal installation All contains themes and modules that can be used for all sites in this drupal installation. to create another drupal site, do the following edit virtual host and add: ServerAlias newhostname and reload apache in sites do this: cp -r default newhostname and then edit the config vim newhostname/settings.php You can either give this site it's own database (i like this way) or, give it it's own table prefix

5. using your browser, go to http://yoursite/install.php.

6. Create a first user.



Other related posts:
Google Code Jam
ANZ's Internet banking goes to insane lengths to be more insecure..
microsoft supporting old edition of ODF






Comment by deeknow, on 3-Aug-2007 13:47

Hey there, was wondering if you know of anyone in NZ who offers commercial support for Drupal in any shape of form? Ideally someone who also knows a thing or two about Content-management as well.


Comment by kwd, on 23-Aug-2010 22:12

Thanks, heh. You have a lovely blog over there too! kwd [url="http://thebest25sites.com/video"]kwd[/url] http://thebest25sites.com/video kwd kwd [url="http://activeusacenter.net/clips"]kwd[/url] http://activeusacenter.net/clips kwd kwd [url="http://160db.com/young"]kwd[/url] http://160db.com/young kwd kwd [url="http://www.livetogame.com/digimon"]kwd[/url] http://www.livetogame.com/digimon kwd kwd [url="http://express-creations.com/yuri"]kwd[/url] http://express-creations.com/yuri kwd


Add a comment

Please note: comments that are inappropriate or promotional in nature will be deleted. E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.

Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and shown in this blog post.

Your name:

Your e-mail:

Your webpage:

taniwha's profile

Wally (Brenda) 
Te Whanganui O Tara
New Zealand