Configuring Cron Job for Drupal

No Comments »

Some modules require regularly scheduled actions, such as cleaning up log files. You can make these happen automatically by using cron jobs. Schedule a cron job that regularly visits the “cron page”. This regular visit will automatically tell Drupal to perform its periodic tasks, and this will help keep your system running smoothly.

If your site is http://www.example.com then the page would be found at http://www.example.com/cron.php. Here is an example of a cron job that uses wget to visit the cron page:

0 2 * * * wget --quiet http://www.example.com/cron.php

Installing TinyMCE Editor in Drupal

No Comments »

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor.

Before you start download the following:

Extract the TinyMCE module into the the directory below. This is where the integration code is located.

sites/all/modules/tinymce

Extract the TinyMCE editor into the directory below. This is where the actually editor is located.

sites/all/modules/tinymce/tinymce

Enable the module by navigating to:

Administer > Site building > Modules

Setup the permission to determine who can use this module by navigating to:

Administer > User Management > Access Control

To configure TinyMCE, a new profile needs to be created by navigating to:

Administer > Site Configuration > TinyMCE

If you use Filtered HTML for your Input format, then you may need to modify the Allowed HTML tags list depending on what buttons you chose for your profile. For example, bold, italic, and underline button will need the <b>, <i>, and <u> tag added. To change the Input formats navigate to:

Administer > Site Configuration > Input formats

Configuring Multiple Sites with Drupal

No Comments »

A single Drupal installation can host several Drupal-powered sites, each with its own individual configuration.

Configuration

Additional sites configurations are represented by creating subdirectories under the ’sites’ directory of the Drupal installation. For example, the configuration for www.vincentkong.com could be ’sites/www.vincentkong.com’. If users can access the site at http://vincentkong.com as well then ‘www.’ should be omitted. Subdomains are also support, for example, my.vincentkong.com would be ’sites/my.vincentkong.com’. Drupal will transverse through the directories and find the best matching directory for the site requested.

After the proper directory for your domain has been created copy the default configuration file ‘/sites/default/settings.php’ into the your new directory.

$ cp ./sites/default/settings.php ./sites/vincentkong.com

Run the install script by pointing your browser to the base url of your website (e.g http://www.vincentkong.com), and follow through with the setup screens. Ensure that you DO NOT overwrite any existing databases.

Site-Specific Modules and Themes

Each site can have it’s own specific modules and themes in additional to those installed in the standard ‘modules’ and ‘themes’ directories in the base installation. To use site-specific modules or themes, create the ‘modules’ or ‘themes’ directory within the site configuration directory.

$ mkdir ./site/vincentkong.com/modules
$ mkdir ./site/vincentkong.com/themes

Apache

When setting up virtual hosting for Apache to support multiple sites for Drupal, the DocumentRoot for all the sites should be set to the base directory of the Drupal installation. For example if my Drupal was installed in /var/www/html

<VirtualHost *>
ServerName www.vincentkong.com
DocumentRoot /var/www/drupal
</VirtualHost>

<VirtualHost *>
ServerName my.vincentkong.com
DocumentRoot /var/www/drupal
</VirtualHost>

Drupal Quickstart Guide

, No Comments »

Drupal is a free modular content management system written in PHP.

Required PHP Extension

  • MySQL
    $ sudo apt-get install php5-mysql
  • GD Library
    $ sudo apt-get install php5-gd

Installation

Download the latest Drupal release from http://drupal.org.

$ wget http://drupal.org/files/projects/drupal-6.2.tar.gz

Extracting the .tar.gz file will create a new directory drupal-6.2 which contains all the Drupal files and directories.

$ tar -zxvf drupal-6.2.tar.gz

Move all the files inside the directory into a directory within your web server’s document root or your public HTML directory.

$ mv drupal-6.2/* /var/www/drupal

Create a database for drupal. For MySQL:

mysql> create database databasename
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';

Make sure that you have write permission on the directory ./sites/default/

$ chmod 777 ./sites/default

Run the install script by pointing your browser to the base url of your website (e.g http://www.vincentkong.com), which will bring you through an installation wizard to setup Drupal.

Choose language:

Choose language

Database configuration:

Database configuration

Configure site:

Configure site

After the installation has been completed the write permission should be removed from the .sites/default directory.

$ chmod 755 .sites/default

For more information refer to the Getting Started guide for Drupal.

My Profile Settings for TinyMCE Editor

No Comments »

These are the settings for my profile:

Basic setup

Profile name: default

Roles allowed to use this profile: authenticated user

Default state: enabled

Allow users to choose default: true

Show disable/enable rich text editor toggle: true

Language: en

Safari browser warning: false

Buttons and plugins

  • bold
  • italic
  • underline
  • justifyleft
  • justifycenter
  • justifyright
  • bullist
  • numlist
  • outdent
  • indent
  • link
  • unlink
  • image
  • code
  • cut
  • copy
  • paste
  • fontselect - font
  • fontsizeselect - font
  • tablecontrols

Editor appearance

Toolbar location: top

Toolbar alignment: left

Path location: bottom

Enable resizing button: true

Block formats: p,address,pre,h1,h2,h3,h4,h5,h6

Cleanup and output

Verify HTML: false

Preformatted: false

Convert <font> tags to styles: true

Remove linebreaks: true

Apply source formatting: true

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in