Drupal + Postfix Integration Under Ubuntu 8.04 (Hardy) - Page 4

Want to support HowtoForge? Become a subscriber!
 
Submitted by asaavedra (Contact Author) (Forums) on Tue, 2008-10-07 15:48. ::

Drupal Installation and Configuration

We will download and install Drupal 6.x. Then we will download and install Mailfix module (http://drupal.org/project/mailfix) which as of this writing is only available for Drupal version 6.x.

Drupal files will be unpacked in /var/www/example.com.

cd /var/www
wget http://ftp.drupal.org/files/projects/drupal-6.x.tar.gz

As of this writing, current version is 6.4, thus the target file would be drupal-6.4.tar.gz. Just keep in mind that you must replace the 6.x part with the appropriate Drupal version. 

tar -xvzf drupal-6.x.tar.gz
mv drupal-6.x example.com
cd example.com
mkdir -p sites/all/modules
cd sites/all/modules
wget http://ftp.drupal.org/files/projects/mailfix-6.x-1.1.tar.gz

tar -xvzf mailfix-6.x-1.1.tar.gz
cd /var/www
chown -R www-data.www-data example.com

Now we need to create the Drupal database, which will be named as drupal_example_com in our tutorial and will be accessible with full privileges by user drupal_example_com@localhost:

mysql -p
mysql> create database drupal_example_com;

Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on drupal_example_com.* to drupal_example_com @localhost identified by 'secret' with grant option;

Query OK, 0 rows affected (0.00 sec)

mysql> quit

Web interface configuration can proceed by accessing http://www.example.com directly. Follow the instructions on screen to setup your Drupal site.

The next task to accomplish is to create your first Drupal account, which will be granted total administrative privileges. Remember we asked you to write down your Drupal credentials before? Well, this is where you're expected to apply them.

Then we configure cron entry for Drupal self-maintenance:

crontab -e

# Example Drupal site cron
49 * * * * /usr/bin/wget -O - -q http://www.example.com/cron.php &> /dev/null

The &> /dev/null part is intended to reduce mail alerts issued by crontab.

Now we configure uploaded files directory. This is also a matter of personal taste. We prefer those files to be transferred by Drupal, so they must reside outside the /var/www/example.com directory. We create /var/drupal_files directory for this purpose and make it writable by Apache daemon:

cd /var
mkdir -p drupal_files/example.com
chown -R www-data.www-data drupal_files/

Inside Drupal we configure the File System with this structure in mind:

  • File System Path: /var/drupal_files/example.com
  • Download Method: Private

You may proceed to install and configure the Mailfix module:

  • Go to Administer → Site building → Modules
  • Enable the Mailfix module

From here you may add all mail domains your Drupal system is intended to control:

  • Go to Administer → Site Configuration → Mailfix domains
  • Then go to Add domains

The Mailfix documentation is self-explanatory.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.