Setup Drupal 5

The station's website will be build using Drupal an extremely powerful, open source content managment system written in PHP.

Drupal uses some PHP functions that require the installation of additional ports. You'll need:

  • devel/php5-pcre - Perl regular expressions.
  • textproc/php5-xml - XML parsing.
  • databases/php5-mysqli - MySQL support for PHP.
  • www/php5-session - Session support.
  • graphics/php5-gd - Image handing. Optional, some modules need it.
  • converters/php5-mbstring - Unicode support. Optional, but Drupal prefers that it be installed.

Create the database

Create Drupal's database:

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.11-beta

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE drupal;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON drupal.* TO drupal@localhost IDENTIFIED BY 'a secret password';
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Download

Create a directory for Drupal and give the web server permission to read it:

$ mkdir /usr/local/www/drupal
$ cd /usr/local/www
$ chown :www drupal

Now that we've created the webroot directory, we need to (re)start Apache:

$ /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
apache22 not running? (check /var/run/httpd.pid).
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

Check out Drupal with CVS:

$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-5 drupal

Create Drupal's files directory:

$ cd /usr/local/www/drupal/
$ mkdir files
$ chmod g+w files/

Since Drupal 5 does the rest of the database setup via the web, we need to temporarily allow the web user to modify the Drupal configuration file:

$ chmod g+w /usr/local/www/drupal/sites/default/settings.php

Setup

Open up your browser and point it to your webserver. You should be presented with a form to supply your database name, user and password.

Once you complete the form Drupal will finish setting up your database and provide a warning that you need to write protect the settings file. Follow the link to the new site and create an admin user.

Now that the setup is finishe, write protect your Drupal configuration file with the following command:

$ chmod g-w /usr/local/www/drupal/sites/default/settings.php

Cron jobs

Drupal has different tasks that need to be run periodically. To do so it provides a script named cron.php that is run via the web server. We can use FreeBSD's cron program to automate the process of running the script.

Add a crontask to web server's user account:

$ crontab -e -u www

And add the following line the file to run the script once an hour. Remember to change the URL:

5 * * * * /usr/bin/fetch -q -o - http://example.com/cron.php > /dev/null

for you, a photo

lawn furniture + inflatable pool

ads

User login